mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-10 23:07:47 +00:00
Enqueue RefreshProductsCacheJob with lower than default priority
This commit is contained in:
@@ -41,7 +41,7 @@ module OpenFoodNetwork
|
||||
end
|
||||
|
||||
def self.enqueue_job(distributor, order_cycle)
|
||||
Delayed::Job.enqueue RefreshProductsCacheJob.new distributor.id, order_cycle.id
|
||||
Delayed::Job.enqueue RefreshProductsCacheJob.new(distributor.id, order_cycle.id), priority: 10
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -13,6 +13,12 @@ module OpenFoodNetwork
|
||||
ProductsCacheRefreshment.refresh distributor, order_cycle
|
||||
end.to enqueue_job RefreshProductsCacheJob
|
||||
end
|
||||
|
||||
it "enqueues the job with a lower than default priority" do
|
||||
ProductsCacheRefreshment.refresh distributor, order_cycle
|
||||
job = Delayed::Job.last
|
||||
expect(job.priority).to be > Delayed::Worker.default_priority
|
||||
end
|
||||
end
|
||||
|
||||
describe "when there is an enqueued task, and it is running" do
|
||||
|
||||
Reference in New Issue
Block a user