Skip to content

Commit 259f7d2

Browse files
authored
Added more logging (#2417)
1 parent c055cda commit 259f7d2

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

app/celery/reporting_tasks.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,12 @@ def create_nightly_notification_status(day_start=None):
7272
else:
7373
# When calling the task its a string in the format of "YYYY-MM-DD"
7474
day_start = datetime.strptime(day_start, "%Y-%m-%d").date()
75+
current_app.logger.info("create-nightly-notification-status started for {} ".format(day_start))
7576
for i in range(0, 4):
7677
process_day = day_start - timedelta(days=i)
77-
78+
current_app.logger.info(
79+
"create-nightly-notification-status-for-day called from higher level job for day {} ".format(process_day)
80+
)
7881
create_nightly_notification_status_for_day.apply_async(
7982
kwargs={"process_day": process_day.isoformat()}, queue=QueueNames.REPORTING
8083
)
@@ -94,6 +97,7 @@ def create_nightly_notification_status_for_day(process_day):
9497
service_ids = [x.id for x in Service.query.all()]
9598
chunk_size = 10
9699
iter_service_ids = iter(service_ids)
100+
current_app.logger.info("create-nightly-notification-status-for-day STARTED for day {} ".format(process_day))
97101

98102
while True:
99103
chunk = list(islice(iter_service_ids, chunk_size))

app/dao/fact_notification_status_dao.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,11 @@ def update_fact_notification_status(data, process_day, service_ids=None):
135135

136136
except IntegrityError as e:
137137
db.session.rollback()
138-
current_app.logger.error(f"Integrity error in update_fact_notification_status: {e}")
138+
current_app.logger.info(f"Integrity error in update_fact_notification_status: {e}")
139139
raise
140140
except Exception as e:
141141
db.session.rollback()
142-
current_app.logger.error(f"Unexpected error in update_fact_notification_status: {e}")
142+
current_app.logger.info(f"Unexpected error in update_fact_notification_status: {e}")
143143
raise
144144

145145

0 commit comments

Comments
 (0)