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