feat: Add a job to reopen snoozed notifications (#8545)

This commit is contained in:
Muhsin Keloth
2024-01-05 15:13:22 +05:30
committed by GitHub
parent 8a8f325f64
commit 68062216e4
4 changed files with 40 additions and 0 deletions

View 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

View File

@@ -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