mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
only trigger DVLA tasks if there is data to send
This commit is contained in:
@@ -316,6 +316,7 @@ def populate_monthly_billing():
|
|||||||
@statsd(namespace="tasks")
|
@statsd(namespace="tasks")
|
||||||
def run_letter_jobs():
|
def run_letter_jobs():
|
||||||
job_ids = dao_get_letter_job_ids_by_status(JOB_STATUS_READY_TO_SEND)
|
job_ids = dao_get_letter_job_ids_by_status(JOB_STATUS_READY_TO_SEND)
|
||||||
|
if job_ids:
|
||||||
notify_celery.send_task(
|
notify_celery.send_task(
|
||||||
name=TaskNames.DVLA_JOBS,
|
name=TaskNames.DVLA_JOBS,
|
||||||
args=(job_ids,),
|
args=(job_ids,),
|
||||||
@@ -331,6 +332,7 @@ def run_letter_notifications():
|
|||||||
|
|
||||||
notifications = dao_set_created_live_letter_api_notifications_to_pending()
|
notifications = dao_set_created_live_letter_api_notifications_to_pending()
|
||||||
|
|
||||||
|
if notifications:
|
||||||
file_contents = create_dvla_file_contents_for_notifications(notifications)
|
file_contents = create_dvla_file_contents_for_notifications(notifications)
|
||||||
|
|
||||||
file_location = '{}-dvla-notifications.txt'.format(current_time)
|
file_location = '{}-dvla-notifications.txt'.format(current_time)
|
||||||
|
|||||||
Reference in New Issue
Block a user