From 259f7d202892f525500fa0cf5531610fc56a9358 Mon Sep 17 00:00:00 2001 From: Jumana B Date: Thu, 16 Jan 2025 11:15:55 -0500 Subject: [PATCH] Added more logging (#2417) --- app/celery/reporting_tasks.py | 6 +++++- app/dao/fact_notification_status_dao.py | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/celery/reporting_tasks.py b/app/celery/reporting_tasks.py index 853c6f6b7b..82e3370b00 100644 --- a/app/celery/reporting_tasks.py +++ b/app/celery/reporting_tasks.py @@ -72,9 +72,12 @@ def create_nightly_notification_status(day_start=None): else: # When calling the task its a string in the format of "YYYY-MM-DD" day_start = datetime.strptime(day_start, "%Y-%m-%d").date() + current_app.logger.info("create-nightly-notification-status started for {} ".format(day_start)) for i in range(0, 4): process_day = day_start - timedelta(days=i) - + current_app.logger.info( + "create-nightly-notification-status-for-day called from higher level job for day {} ".format(process_day) + ) create_nightly_notification_status_for_day.apply_async( kwargs={"process_day": process_day.isoformat()}, queue=QueueNames.REPORTING ) @@ -94,6 +97,7 @@ def create_nightly_notification_status_for_day(process_day): service_ids = [x.id for x in Service.query.all()] chunk_size = 10 iter_service_ids = iter(service_ids) + current_app.logger.info("create-nightly-notification-status-for-day STARTED for day {} ".format(process_day)) while True: chunk = list(islice(iter_service_ids, chunk_size)) diff --git a/app/dao/fact_notification_status_dao.py b/app/dao/fact_notification_status_dao.py index 80ed2700fc..10f1cf976a 100644 --- a/app/dao/fact_notification_status_dao.py +++ b/app/dao/fact_notification_status_dao.py @@ -135,11 +135,11 @@ def update_fact_notification_status(data, process_day, service_ids=None): except IntegrityError as e: db.session.rollback() - current_app.logger.error(f"Integrity error in update_fact_notification_status: {e}") + current_app.logger.info(f"Integrity error in update_fact_notification_status: {e}") raise except Exception as e: db.session.rollback() - current_app.logger.error(f"Unexpected error in update_fact_notification_status: {e}") + current_app.logger.info(f"Unexpected error in update_fact_notification_status: {e}") raise