aboutsummaryrefslogtreecommitdiffstats
path: root/lib/active_job/queue_adapters
diff options
context:
space:
mode:
Diffstat (limited to 'lib/active_job/queue_adapters')
-rw-r--r--lib/active_job/queue_adapters/sidekiq_adapter.rb2
-rw-r--r--lib/active_job/queue_adapters/sucker_punch_adapter.rb8
2 files changed, 1 insertions, 9 deletions
diff --git a/lib/active_job/queue_adapters/sidekiq_adapter.rb b/lib/active_job/queue_adapters/sidekiq_adapter.rb
index 41f58f554a..c6faf9d054 100644
--- a/lib/active_job/queue_adapters/sidekiq_adapter.rb
+++ b/lib/active_job/queue_adapters/sidekiq_adapter.rb
@@ -10,8 +10,6 @@ module ActiveJob
def queue_at(job, timestamp, *args)
job = { class: JobWrapper, queue: job.queue_name, args: [ job, *args ], at: timestamp }
- # Optimization to enqueue something now that is scheduled to go out now or in the past
- job.delete(:at) if timestamp <= Time.now.to_f
JobWrapper.client_push(job)
end
end
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