feat: Add a job to reopen snoozed notifications (#8545)
This commit is contained in:
10
app/jobs/notification/reopen_snoozed_notifications_job.rb
Normal file
10
app/jobs/notification/reopen_snoozed_notifications_job.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class Notification::ReopenSnoozedNotificationsJob < ApplicationJob
|
||||
queue_as :low
|
||||
|
||||
def perform
|
||||
# rubocop:disable Rails/SkipsModelValidations
|
||||
Notification.where(snoozed_until: 3.days.ago..Time.current)
|
||||
.update_all(snoozed_until: nil, updated_at: Time.current, last_activity_at: Time.current)
|
||||
# rubocop:enable Rails/SkipsModelValidations
|
||||
end
|
||||
end
|
||||
@@ -11,6 +11,9 @@ class TriggerScheduledItemsJob < ApplicationJob
|
||||
# Job to reopen snoozed conversations
|
||||
Conversations::ReopenSnoozedConversationsJob.perform_later
|
||||
|
||||
# Job to reopen snoozed notifications
|
||||
Notification::ReopenSnoozedNotificationsJob.perform_later
|
||||
|
||||
# Job to auto-resolve conversations
|
||||
Account::ConversationsResolutionSchedulerJob.perform_later
|
||||
|
||||
|
||||
Reference in New Issue
Block a user