diff options
author | Mike Perham <mperham@gmail.com> | 2014-05-20 08:36:24 -0700 |
---|---|---|
committer | Mike Perham <mperham@gmail.com> | 2014-05-20 08:36:24 -0700 |
commit | 1d3ba6881e03bc3096be2c68e3d28f88e3136f05 (patch) | |
tree | cdfb28b20884ff763b3daa8c9c5df0a6422b3a20 /lib/active_job/queue_adapters/sucker_punch_adapter.rb | |
parent | b49d3f105f765a2c6c440fad5303a2809942422a (diff) | |
download | rails-1d3ba6881e03bc3096be2c68e3d28f88e3136f05.tar.gz rails-1d3ba6881e03bc3096be2c68e3d28f88e3136f05.tar.bz2 rails-1d3ba6881e03bc3096be2c68e3d28f88e3136f05.zip |
Move past time check out of adapters
Diffstat (limited to 'lib/active_job/queue_adapters/sucker_punch_adapter.rb')
-rw-r--r-- | lib/active_job/queue_adapters/sucker_punch_adapter.rb | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/active_job/queue_adapters/sucker_punch_adapter.rb b/lib/active_job/queue_adapters/sucker_punch_adapter.rb index e483c0844b..8125499695 100644 --- a/lib/active_job/queue_adapters/sucker_punch_adapter.rb +++ b/lib/active_job/queue_adapters/sucker_punch_adapter.rb @@ -9,13 +9,7 @@ module ActiveJob end def queue_at(job, timestamp, *args) - secs = Time.now.to_f - timestamp - if secs < 1 - # Optimization to enqueue something now that is scheduled to go out now or in the past - JobWrapper.new.async.perform(job, *args) - else - JobWrapper.new.async.later(secs, job, *args) - end + JobWrapper.new.async.later(secs, job, *args) end end |