mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-20 14:29:25 -04:00
Merge pull request #863 from alphagov/create-dvla-file
Added logging for any exception thrown in build_dvla_file
This commit is contained in:
@@ -265,6 +265,7 @@ def persist_letter(
|
|||||||
@notify_celery.task(bind=True, name="build-dvla-file", max_retries=15, default_retry_delay=300)
|
@notify_celery.task(bind=True, name="build-dvla-file", max_retries=15, default_retry_delay=300)
|
||||||
@statsd(namespace="tasks")
|
@statsd(namespace="tasks")
|
||||||
def build_dvla_file(self, job_id):
|
def build_dvla_file(self, job_id):
|
||||||
|
try:
|
||||||
if all_notifications_are_created_for_job(job_id):
|
if all_notifications_are_created_for_job(job_id):
|
||||||
notifications = dao_get_all_notifications_for_job(job_id)
|
notifications = dao_get_all_notifications_for_job(job_id)
|
||||||
file = ""
|
file = ""
|
||||||
@@ -281,6 +282,9 @@ def build_dvla_file(self, job_id):
|
|||||||
else:
|
else:
|
||||||
current_app.logger.info("All notifications for job {} are not persisted".format(job_id))
|
current_app.logger.info("All notifications for job {} are not persisted".format(job_id))
|
||||||
self.retry(queue="retry", exc="All notifications for job {} are not persisted".format(job_id))
|
self.retry(queue="retry", exc="All notifications for job {} are not persisted".format(job_id))
|
||||||
|
except Exception as e:
|
||||||
|
current_app.logger.exception("build_dvla_file threw exception")
|
||||||
|
raise e
|
||||||
|
|
||||||
|
|
||||||
def s3upload(filedata, region, bucket_name, file_location):
|
def s3upload(filedata, region, bucket_name, file_location):
|
||||||
|
|||||||
Reference in New Issue
Block a user