0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-09 21:45:25 +08:00
discourse/app/jobs/scheduled/process_user_notification_schedules.rb
Jarek Radosz fbb3bf3fe8
DEV: Enable Style/RedundantBegin rubocop rule (#40096)
(to be enabled in the shared config)

best reviewed with whitespace disabled
2026-05-19 18:44:54 +02:00

21 lines
498 B
Ruby
Vendored

# frozen_string_literal: true
module Jobs
class ProcessUserNotificationSchedules < ::Jobs::Scheduled
every 1.day
def execute(args)
UserNotificationSchedule
.enabled
.includes(:user)
.each do |schedule|
schedule.create_do_not_disturb_timings
rescue => e
Discourse.warn_exception(
e,
message: "Failed to process user_notification_schedule with ID #{schedule.id}",
)
end
end
end
end