0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-13 21:42:53 +01:00
discourse-custom-wizard/jobs/set_after_time_wizard.rb

22 Zeilen
558 B
Ruby

2017-11-01 05:21:14 +01:00
module Jobs
2019-10-03 07:17:21 +02:00
class SetAfterTimeWizard < ::Jobs::Base
2017-11-01 05:21:14 +01:00
def execute(args)
2020-04-14 07:46:06 +02:00
if SiteSetting.custom_wizard_enabled
wizard = CustomWizard::Wizard.find(args[:wizard_id])
if wizard && wizard.after_time
user_ids = []
2020-04-14 07:46:06 +02:00
User.human_users.each do |user|
if CustomWizard::Wizard.set_wizard_redirect(wizard.id, user)
user_ids.push(user.id)
end
end
2020-04-14 07:46:06 +02:00
MessageBus.publish "/redirect_to_wizard", wizard.id, user_ids: user_ids
end
2017-11-01 05:21:14 +01:00
end
end
end
end