mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-18 21:48:49 -04:00
Use short dates when selection notifications for deletion.
This means we will retain notifications for a full week and not delete records that are 7 x 24 hours older than the time of the run of the deletion task. Also the task only needs to run once a day now, so I have changed the celery config for the deletion tasks.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from datetime import timedelta
|
||||
from celery.schedules import crontab
|
||||
from kombu import Exchange, Queue
|
||||
import os
|
||||
|
||||
@@ -51,12 +52,12 @@ class Config(object):
|
||||
},
|
||||
'delete-failed-notifications': {
|
||||
'task': 'delete-failed-notifications',
|
||||
'schedule': timedelta(minutes=60),
|
||||
'schedule': crontab(minute=0, hour=0),
|
||||
'options': {'queue': 'periodic'}
|
||||
},
|
||||
'delete-successful-notifications': {
|
||||
'task': 'delete-successful-notifications',
|
||||
'schedule': timedelta(minutes=31),
|
||||
'schedule': crontab(minute=0, hour=0),
|
||||
'options': {'queue': 'periodic'}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user