Use ActiveJob instead of Resque directly
This allows us to directly pass entities to the job.
This commit is contained in:
parent
07c8393c8c
commit
47d9c79617
16 changed files with 76 additions and 73 deletions
|
|
@ -260,7 +260,7 @@ class Order < ApplicationRecord
|
|||
ordergroups.each(&:update_stats!)
|
||||
|
||||
# Notifications
|
||||
Resque.enqueue(UserNotifier, FoodsoftConfig.scope, 'finished_order', self.id)
|
||||
NotifyFinishedOrderJob.perform_later(self)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class Ordergroup < Group
|
|||
update_balance!
|
||||
# Notify only when order group had a positive balance before the last transaction:
|
||||
if t.amount < 0 && self.account_balance < 0 && self.account_balance - t.amount >= 0
|
||||
Resque.enqueue(UserNotifier, FoodsoftConfig.scope, 'negative_balance', self.id, t.id)
|
||||
NotifyNegativeBalanceJob.perform_later(self, t)
|
||||
end
|
||||
t
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue