From f2f71516bc7c2a8c1f14a306bc40789c6f320f20 Mon Sep 17 00:00:00 2001 From: Andy Shultz Date: Tue, 20 Dec 2022 09:22:48 -0500 Subject: [PATCH] fix: when making a hasty exit from goals, make sure to get the log out --- .../course_goals/management/commands/goal_reminder_email.py | 2 ++ 1 file changed, 2 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 7c4fdf59de..be344dcb0d 100644 --- a/lms/djangoapps/course_goals/management/commands/goal_reminder_email.py +++ b/lms/djangoapps/course_goals/management/commands/goal_reminder_email.py @@ -122,6 +122,8 @@ class Command(BaseCommand): self._handle_all_goals() except BaseException: # pylint: disable=broad-except log.exception("Error while sending course goals emails: ") + for h in log.handlers: + h.flush() raise def _handle_all_goals(self):