mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-05 02:41:14 -05:00
Move nightly tasks before introduction of archived flag on jobs
This commit is contained in:
committed by
Alexey Bezhan
parent
be6f37069b
commit
e5fd027192
@@ -67,6 +67,7 @@ def remove_csv_files(job_types):
|
|||||||
jobs = dao_get_jobs_older_than_data_retention(notification_types=job_types)
|
jobs = dao_get_jobs_older_than_data_retention(notification_types=job_types)
|
||||||
for job in jobs:
|
for job in jobs:
|
||||||
s3.remove_job_from_s3(job.service_id, job.id)
|
s3.remove_job_from_s3(job.service_id, job.id)
|
||||||
|
# job.archived = true; commit;
|
||||||
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))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -236,6 +236,11 @@ class Config(object):
|
|||||||
'schedule': crontab(hour=2, minute=0),
|
'schedule': crontab(hour=2, minute=0),
|
||||||
'options': {'queue': QueueNames.PERIODIC}
|
'options': {'queue': QueueNames.PERIODIC}
|
||||||
},
|
},
|
||||||
|
'remove_transformed_dvla_files': {
|
||||||
|
'task': 'remove_transformed_dvla_files',
|
||||||
|
'schedule': crontab(hour=3, minute=40),
|
||||||
|
'options': {'queue': QueueNames.PERIODIC}
|
||||||
|
},
|
||||||
'remove_sms_email_jobs': {
|
'remove_sms_email_jobs': {
|
||||||
'task': 'remove_csv_files',
|
'task': 'remove_csv_files',
|
||||||
'schedule': crontab(hour=4, minute=0),
|
'schedule': crontab(hour=4, minute=0),
|
||||||
@@ -244,15 +249,11 @@ class Config(object):
|
|||||||
},
|
},
|
||||||
'remove_letter_jobs': {
|
'remove_letter_jobs': {
|
||||||
'task': 'remove_csv_files',
|
'task': 'remove_csv_files',
|
||||||
'schedule': crontab(hour=4, minute=20),
|
'schedule': crontab(hour=4, minute=20), # this has to run AFTER remove_transformed_dvla_files
|
||||||
|
# since we mark jobs as archived
|
||||||
'options': {'queue': QueueNames.PERIODIC},
|
'options': {'queue': QueueNames.PERIODIC},
|
||||||
'kwargs': {'job_types': [LETTER_TYPE]}
|
'kwargs': {'job_types': [LETTER_TYPE]}
|
||||||
},
|
},
|
||||||
'remove_transformed_dvla_files': {
|
|
||||||
'task': 'remove_transformed_dvla_files',
|
|
||||||
'schedule': crontab(hour=4, minute=40),
|
|
||||||
'options': {'queue': QueueNames.PERIODIC}
|
|
||||||
},
|
|
||||||
'raise-alert-if-letter-notifications-still-sending': {
|
'raise-alert-if-letter-notifications-still-sending': {
|
||||||
'task': 'raise-alert-if-letter-notifications-still-sending',
|
'task': 'raise-alert-if-letter-notifications-still-sending',
|
||||||
'schedule': crontab(hour=16, minute=30),
|
'schedule': crontab(hour=16, minute=30),
|
||||||
|
|||||||
Reference in New Issue
Block a user