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):