Republish gov.uk/alerts every night to clear down planned tests

We have made it so that gov.uk/alerts shows a ‘1 planned test’ banner
for the whole of the day when there has been an operator test on that
day.

We need to remove the banner when the day is over.

The most straightforward way to do this is to republish the site at the
start of every day. The gov.uk/alerts code[1] will work out if there are
or aren’t any planned tests to show that day.

1. 5a274af6d0/app/models/alerts.py (L38-L44)
This commit is contained in:
Chris Hill-Scott
2021-11-04 09:16:20 +00:00
parent 2f3c6112ba
commit 0236318189
3 changed files with 27 additions and 0 deletions

View File

@@ -332,6 +332,11 @@ class Config(object):
'schedule': timedelta(minutes=5),
'options': {'queue': QueueNames.PERIODIC}
},
'remove-yesterdays-planned-tests-on-govuk-alerts': {
'task': 'remove-yesterdays-planned-tests-on-govuk-alerts',
'schedule': crontab(hour=00, minute=00),
'options': {'queue': QueueNames.PERIODIC}
},
}
}