Merge pull request #6654 from ivanscinote/SCI-9636-IK

Add notification cleanup job [SCI-9636]
This commit is contained in:
Martin Artnik 2023-11-27 17:48:27 +01:00 committed by GitHub
commit dd2b33ddaf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View file

@ -0,0 +1,7 @@
# frozen_string_literal: true
class NotificationCleanupJob < ApplicationJob
def perform
Notification.where('created_at < ?', 3.months.ago).delete_all
end
end

View file

@ -26,3 +26,7 @@ scheduler.every '1h' do
MyModules::DueDateReminderJob.perform_now
RepositoryItemDateReminderJob.perform_now
end
scheduler.every '1d' do
NotificationCleanupJob.perform_now
end