Skip to content

Commit 6e12a24

Browse files
committed
Fixed loading past cron jobs
1 parent e8f5a62 commit 6e12a24

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
@@ -587,7 +586,7 @@ def parse_args(args)
587586
def parse_enqueue_time(timestamp)
588587
DateTime.strptime(timestamp, LAST_ENQUEUE_TIME_FORMAT).to_time.utc
589588
rescue ArgumentError
590-
DateTime.strptime(timestamp, LAST_ENQUEUE_TIME_FORMAT_OLD).to_time.utc
589+
DateTime.parse(timestamp).to_time.utc
591590
end
592591

593592
def not_past_scheduled_time?(current_time)

0 commit comments

Comments
 (0)