Fixed bug in letter job schedule

This commit is contained in:
Ken Tsang
2017-08-22 14:23:35 +01:00
parent 62172ce39b
commit b2b74e2b5d
3 changed files with 37 additions and 16 deletions

View File

@@ -308,10 +308,10 @@ def populate_monthly_billing():
@notify_celery.task(name="run-letter-jobs")
@statsd(namespace="tasks")
def run_letter_jobs():
ids = dao_get_letter_jobs_by_status(JOB_STATUS_READY_TO_SEND)
job_ids = [job.id for job in dao_get_letter_jobs_by_status(JOB_STATUS_READY_TO_SEND)]
notify_celery.send_task(
name=QueueNames.DVLA_FILES,
args=(ids),
args=(job_ids),
queue=QueueNames.PROCESS_FTP
)
current_app.logger.info("Queued {} ready letter job ids onto {}".format(len(ids), QueueNames.PROCESS_FTP))
current_app.logger.info("Queued {} ready letter job ids onto {}".format(len(job_ids), QueueNames.PROCESS_FTP))