mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-10 22:06:46 +08:00
Merge pull request #6654 from ivanscinote/SCI-9636-IK
Add notification cleanup job [SCI-9636]
This commit is contained in:
commit
dd2b33ddaf
2 changed files with 11 additions and 0 deletions
7
app/jobs/notification_cleanup_job.rb
Normal file
7
app/jobs/notification_cleanup_job.rb
Normal 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
|
|
@ -26,3 +26,7 @@ scheduler.every '1h' do
|
||||||
MyModules::DueDateReminderJob.perform_now
|
MyModules::DueDateReminderJob.perform_now
|
||||||
RepositoryItemDateReminderJob.perform_now
|
RepositoryItemDateReminderJob.perform_now
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scheduler.every '1d' do
|
||||||
|
NotificationCleanupJob.perform_now
|
||||||
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue