From 80121ae192d3858b81d76c6031c951125a4230cf Mon Sep 17 00:00:00 2001 From: Ahtisham Shahid Date: Wed, 4 Dec 2024 12:35:56 +0500 Subject: [PATCH] chore: added logs for goal reminder email --- .../course_goals/management/commands/goal_reminder_email.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lms/djangoapps/course_goals/management/commands/goal_reminder_email.py b/lms/djangoapps/course_goals/management/commands/goal_reminder_email.py index 66dd9e4c627..c0287a428a4 100644 --- a/lms/djangoapps/course_goals/management/commands/goal_reminder_email.py +++ b/lms/djangoapps/course_goals/management/commands/goal_reminder_email.py @@ -119,7 +119,12 @@ def send_ace_message(goal, session_id): with emulate_http_request(site, user): try: + ## Add logs to track time taken to send email + start_time = datetime.now() ace.send(msg) + end_time = datetime.now() + log.info(f"Goal Reminder for {user.id} for course {goal.course_key} sent in {end_time - start_time} " + f"using {'SES' if is_ses_enabled else 'others'}") except Exception as exc: # pylint: disable=broad-except log.error(f"Goal Reminder for {user.id} for course {goal.course_key} could not send: {exc}") tracker.emit(