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:
Adam Shimali
2016-04-25 16:12:46 +01:00
parent 4e4a5abbad
commit 24ea6f1637
4 changed files with 52 additions and 24 deletions

View File

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