mirror of
https://github.com/discourse/discourse.git
synced 2024-12-04 04:53:38 +08:00
18 lines
434 B
Ruby
18 lines
434 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
module Jobs
|
||
|
class ProcessUserNotificationSchedules < ::Jobs::Scheduled
|
||
|
every 1.day
|
||
|
|
||
|
def execute(args)
|
||
|
UserNotificationSchedule.enabled.includes(:user).each do |schedule|
|
||
|
begin
|
||
|
schedule.create_do_not_disturb_timings
|
||
|
rescue
|
||
|
Rails.logger.warn("Failed to process user_notification_schedule with ID #{schedule.id}")
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|