aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/lib/active_job
diff options
context:
space:
mode:
Diffstat (limited to 'activejob/lib/active_job')
-rw-r--r--activejob/lib/active_job/queue_adapters/test_adapter.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/activejob/lib/active_job/queue_adapters/test_adapter.rb b/activejob/lib/active_job/queue_adapters/test_adapter.rb
index da042cfebf..ec825f12cd 100644
--- a/activejob/lib/active_job/queue_adapters/test_adapter.rb
+++ b/activejob/lib/active_job/queue_adapters/test_adapter.rb
@@ -24,15 +24,11 @@ module ActiveJob
end
def enqueue(job) #:nodoc:
- return if filtered?(job)
-
job_data = job_to_hash(job)
enqueue_or_perform(perform_enqueued_jobs, job, job_data)
end
def enqueue_at(job, timestamp) #:nodoc:
- return if filtered?(job)
-
job_data = job_to_hash(job, at: timestamp)
enqueue_or_perform(perform_enqueued_at_jobs, job, job_data)
end
@@ -44,11 +40,11 @@ module ActiveJob
end
def enqueue_or_perform(perform, job, job_data)
- if perform
+ if !perform || filtered?(job)
+ enqueued_jobs << job_data
+ else
performed_jobs << job_data
Base.execute job.serialize
- else
- enqueued_jobs << job_data
end
end