From d772ae6b46cad48bc3ee9aa0657b7b2fda3de387 Mon Sep 17 00:00:00 2001 From: Ben Thorner Date: Tue, 11 Jan 2022 16:46:45 +0000 Subject: [PATCH] Standardise logs for status aggregation tasks This will make it easier to parallelise by service later on. --- app/celery/reporting_tasks.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/celery/reporting_tasks.py b/app/celery/reporting_tasks.py index 28f91cc7f..b11f08261 100644 --- a/app/celery/reporting_tasks.py +++ b/app/celery/reporting_tasks.py @@ -103,7 +103,7 @@ def create_nightly_notification_status(): ) current_app.logger.info( f"create-nightly-notification-status-for-day task created " - f"for type {notification_type} for {process_day}" + f"for {notification_type} and {process_day}" ) @@ -111,7 +111,8 @@ def create_nightly_notification_status(): def create_nightly_notification_status_for_day(process_day, notification_type): process_day = datetime.strptime(process_day, "%Y-%m-%d").date() current_app.logger.info( - f'create-nightly-notification-status-for-day task for {process_day} type {notification_type}: started' + f'create-nightly-notification-status-for-day task started ' + f'for {notification_type} and {process_day}' ) for (service_id,) in db.session.query(Service.id): @@ -124,7 +125,8 @@ def create_nightly_notification_status_for_day(process_day, notification_type): end = datetime.utcnow() current_app.logger.info( - f'create-nightly-notification-status-for-day task for {process_day} type {notification_type}: ' + f'create-nightly-notification-status-for-day task fetch ' + f'for {process_day} and {notification_type}: ' f'data fetched in {(end - start).seconds} seconds' ) @@ -136,6 +138,7 @@ def create_nightly_notification_status_for_day(process_day, notification_type): ) current_app.logger.info( - f'create-nightly-notification-status-for-day task for {process_day} type {notification_type}: ' - f'task complete - {len(transit_data)} rows updated' + f'create-nightly-notification-status-for-day task finished ' + f'for {process_day} and {notification_type}: ' + f'{len(transit_data)} rows updated' )