mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-10 07:12:20 -05:00
Auto expire old broadcast messages
Since the expiry is sent as part of the message payload, we don't
need to invoke the CBC proxies (and indeed there's no way to do so
for an expired alert). In future we plan to extend this task so it
triggers the regeneration of content on gov.uk/alerts.
It's worth noting that 'finishes_at' can theoretically be None, in
which case it's unclear when the alert should expire. While alerts
from the Admin app should always have an expiry [1], we have many
in the DB that don't, so it's worth checking for this scenario.
[1]: 078ac10c8d/app/models/broadcast_message.py (L255)
This commit is contained in:
@@ -323,6 +323,11 @@ class Config(object):
|
||||
'schedule': timedelta(minutes=15),
|
||||
'options': {'queue': QueueNames.PERIODIC}
|
||||
},
|
||||
'auto-expire-broadcast-messages': {
|
||||
'task': 'auto-expire-broadcast-messages',
|
||||
'schedule': timedelta(minutes=5),
|
||||
'options': {'queue': QueueNames.PERIODIC}
|
||||
},
|
||||
}
|
||||
CELERY_QUEUES = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user