Skip to content

Commit 3ffe31a

Browse files
authored
Merge pull request sidekiq-cron#230 from tomprats/fix-past-cron
Fixed loading past cron jobs
2 parents f171fee + 6e12a24 commit 3ffe31a

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

lib/sidekiq/cron/job.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ class Job
1313
#how long we would like to store informations about previous enqueues
1414
REMEMBER_THRESHOLD = 24 * 60 * 60
1515
LAST_ENQUEUE_TIME_FORMAT = '%Y-%m-%d %H:%M:%S %z'
16-
LAST_ENQUEUE_TIME_FORMAT_OLD = '%Y-%m-%d %H:%M:%S'
1716

1817
#crucial part of whole enquing job
1918
def should_enque? time
@@ -588,7 +587,7 @@ def parse_args(args)
588587
def parse_enqueue_time(timestamp)
589588
DateTime.strptime(timestamp, LAST_ENQUEUE_TIME_FORMAT).to_time.utc
590589
rescue ArgumentError
591-
DateTime.strptime(timestamp, LAST_ENQUEUE_TIME_FORMAT_OLD).to_time.utc
590+
DateTime.parse(timestamp).to_time.utc
592591
end
593592

594593
def not_past_scheduled_time?(current_time)

0 commit comments

Comments
 (0)