mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-18 13:38:53 -04:00
Merge pull request #2798 from alphagov/delete-notifications-older-than-retention
Delete notifications older than retention
This commit is contained in:
@@ -62,6 +62,14 @@ def _remove_csv_files(job_types):
|
|||||||
current_app.logger.info("Job ID {} has been removed from s3.".format(job.id))
|
current_app.logger.info("Job ID {} has been removed from s3.".format(job.id))
|
||||||
|
|
||||||
|
|
||||||
|
@notify_celery.task(name="delete-notifications-older-than-retention")
|
||||||
|
@statsd(namespace="tasks")
|
||||||
|
def delete_notifications_older_than_retention():
|
||||||
|
delete_email_notifications_older_than_retention()
|
||||||
|
delete_sms_notifications_older_than_retention()
|
||||||
|
delete_letter_notifications_older_than_retention()
|
||||||
|
|
||||||
|
|
||||||
@notify_celery.task(name="delete-sms-notifications")
|
@notify_celery.task(name="delete-sms-notifications")
|
||||||
@cronitor("delete-sms-notifications")
|
@cronitor("delete-sms-notifications")
|
||||||
@statsd(namespace="tasks")
|
@statsd(namespace="tasks")
|
||||||
|
|||||||
@@ -238,19 +238,9 @@ class Config(object):
|
|||||||
'schedule': crontab(hour=0, minute=30), # after 'timeout-sending-notifications'
|
'schedule': crontab(hour=0, minute=30), # after 'timeout-sending-notifications'
|
||||||
'options': {'queue': QueueNames.REPORTING}
|
'options': {'queue': QueueNames.REPORTING}
|
||||||
},
|
},
|
||||||
'delete-sms-notifications': {
|
'delete-notifications-older-than-retention': {
|
||||||
'task': 'delete-sms-notifications',
|
'task': 'delete-notifications-older-than-retention',
|
||||||
'schedule': crontab(hour=4, minute=15), # after 'create-nightly-notification-status'
|
'schedule': crontab(hour=3, minute=0), # after 'create-nightly-notification-status'
|
||||||
'options': {'queue': QueueNames.PERIODIC}
|
|
||||||
},
|
|
||||||
'delete-email-notifications': {
|
|
||||||
'task': 'delete-email-notifications',
|
|
||||||
'schedule': crontab(hour=4, minute=30), # after 'create-nightly-notification-status'
|
|
||||||
'options': {'queue': QueueNames.PERIODIC}
|
|
||||||
},
|
|
||||||
'delete-letter-notifications': {
|
|
||||||
'task': 'delete-letter-notifications',
|
|
||||||
'schedule': crontab(hour=4, minute=45), # after 'create-nightly-notification-status'
|
|
||||||
'options': {'queue': QueueNames.PERIODIC}
|
'options': {'queue': QueueNames.PERIODIC}
|
||||||
},
|
},
|
||||||
'delete-inbound-sms': {
|
'delete-inbound-sms': {
|
||||||
@@ -258,7 +248,6 @@ class Config(object):
|
|||||||
'schedule': crontab(hour=1, minute=40),
|
'schedule': crontab(hour=1, minute=40),
|
||||||
'options': {'queue': QueueNames.PERIODIC}
|
'options': {'queue': QueueNames.PERIODIC}
|
||||||
},
|
},
|
||||||
|
|
||||||
'send-daily-performance-platform-stats': {
|
'send-daily-performance-platform-stats': {
|
||||||
'task': 'send-daily-performance-platform-stats',
|
'task': 'send-daily-performance-platform-stats',
|
||||||
'schedule': crontab(hour=2, minute=0),
|
'schedule': crontab(hour=2, minute=0),
|
||||||
|
|||||||
Reference in New Issue
Block a user