From fd973179cc792ad159ad8de378c38d58132d7444 Mon Sep 17 00:00:00 2001 From: Martyn Inglis Date: Mon, 14 Mar 2016 11:34:09 +0000 Subject: [PATCH] - Commit session on job update - log at exception level --- app/celery/tasks.py | 2 +- app/dao/notifications_dao.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/celery/tasks.py b/app/celery/tasks.py index 109d010b7..85c681ce9 100644 --- a/app/celery/tasks.py +++ b/app/celery/tasks.py @@ -282,7 +282,7 @@ def send_email(service_id, notification_id, subject, from_address, encrypted_not ) update_notification_reference_by_id(notification_id, reference) except AwsSesClientException as e: - current_app.logger.debug(e) + current_app.logger.exception(e) notification_db_object.status = 'failed' dao_update_notification(notification_db_object) diff --git a/app/dao/notifications_dao.py b/app/dao/notifications_dao.py index be36ee1fc..ce2eb1093 100644 --- a/app/dao/notifications_dao.py +++ b/app/dao/notifications_dao.py @@ -61,6 +61,7 @@ def update_job_sent_count(notification): Job.notifications_sent: Job.notifications_sent + 1, Job.updated_at: datetime.utcnow() }) + db.session.commit() def dao_update_notification(notification):