0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-09 20:02:54 +01:00

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 true
if wizard['after_time'] && new_time 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']) Jobs.enqueue_at(after_time_scheduled, :set_after_time_wizard, wizard_id: wizard['id'])
end end
if existing['after_time'] && !wizard['after_time'] 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']) Jobs.enqueue(:clear_after_time_wizard, wizard_id: wizard['id'])
end end