1
0
Fork 0

Restrict the cancelling of a scheduled after_time job is restricted to the current wizard

Dieser Commit ist enthalten in:
Angus McLeod 2018-04-24 10:55:03 +10:00
Ursprung 11c85270a7
Commit 26302cbad1

Datei anzeigen

@ -92,12 +92,12 @@ class CustomWizard::AdminController < ::ApplicationController
true
if wizard['after_time'] && new_time
Jobs.cancel_scheduled_job(:set_after_time_wizard)
Jobs.cancel_scheduled_job(:set_after_time_wizard, wizard_id: wizard['id'])
Jobs.enqueue_at(after_time_scheduled, :set_after_time_wizard, wizard_id: wizard['id'])
end
if existing['after_time'] && !wizard['after_time']
Jobs.cancel_scheduled_job(:set_after_time_wizard)
Jobs.cancel_scheduled_job(:set_after_time_wizard, wizard_id: wizard['id'])
Jobs.enqueue(:clear_after_time_wizard, wizard_id: wizard['id'])
end