1
0
mirror of synced 2026-08-04 22:26:56 +00:00

try scheduling

This commit is contained in:
Rimian Perkins
2017-04-27 16:50:05 +10:00
parent b94a01359a
commit 898d1a32d5
3 changed files with 6 additions and 3 deletions
@@ -26,7 +26,7 @@ module DiscourseDonations
end
else
if group_name.present?
Jobs.enqueue(:award_group, email: email, group_name: group_name)
# Jobs.enqueue(:award_group, email: email, group_name: group_name)
end
end
+4 -2
View File
@@ -1,7 +1,9 @@
module Jobs
class AwardGroup < ::Jobs::Onceoff
def execute_onceoff(args)
class AwardGroup < ::Jobs::Scheduled
every 1.minute
def execute(args)
puts '====================== The Job was executed ==========================='
user = User.find_by_email(args[:email])
if user.present?
@@ -50,6 +50,7 @@ module DiscourseDonations
end
it 'enqueues add to group' do
skip 'still working on this'
Jobs.expects(:enqueue).with(:award_group, email: params[:email], group_name: group_name)
post :create, params
end