diff options
author | Mike Perham <mperham@gmail.com> | 2014-05-20 09:13:28 -0700 |
---|---|---|
committer | Mike Perham <mperham@gmail.com> | 2014-05-20 09:13:28 -0700 |
commit | 897f86b8d13cd0583dc5e579ed56c6f4064330db (patch) | |
tree | 8afff02f4bc42e2856feeb75d566fedf16cb0f88 /lib/active_job/queue_adapters/sucker_punch_adapter.rb | |
parent | 85880eb427191bdd46967ff3bacf95419df3ef7a (diff) | |
parent | 86a71b154ae16027cedda0d7878bee22195fe04d (diff) | |
download | rails-897f86b8d13cd0583dc5e579ed56c6f4064330db.tar.gz rails-897f86b8d13cd0583dc5e579ed56c6f4064330db.tar.bz2 rails-897f86b8d13cd0583dc5e579ed56c6f4064330db.zip |
merge master
Diffstat (limited to 'lib/active_job/queue_adapters/sucker_punch_adapter.rb')
-rw-r--r-- | lib/active_job/queue_adapters/sucker_punch_adapter.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/active_job/queue_adapters/sucker_punch_adapter.rb b/lib/active_job/queue_adapters/sucker_punch_adapter.rb index 8125499695..79043b06e0 100644 --- a/lib/active_job/queue_adapters/sucker_punch_adapter.rb +++ b/lib/active_job/queue_adapters/sucker_punch_adapter.rb @@ -9,7 +9,12 @@ module ActiveJob end def queue_at(job, timestamp, *args) - JobWrapper.new.async.later(secs, job, *args) + delay = Time.now.to_f - timestamp + if delay > 0 + JobWrapper.new.async.later(delay, job, *args) + else + JobWrapper.new.async.perform(job, *args) + end end end |