From 065300ba651db862d9ef727769440e60ade02018 Mon Sep 17 00:00:00 2001 From: Renzo Lucioni Date: Wed, 11 May 2016 12:28:39 -0400 Subject: [PATCH] Extend program certification task logging to facilitate monitoring during backpopulation Log a message at the info level when the task is called for a user with no completed programs, and another when the task is called for a user who is not eligible for any new program certificates. Part of ECOM-3924. --- openedx/core/djangoapps/programs/tasks/v1/tasks.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openedx/core/djangoapps/programs/tasks/v1/tasks.py b/openedx/core/djangoapps/programs/tasks/v1/tasks.py index 7e31fa4db7..8e8227cfde 100644 --- a/openedx/core/djangoapps/programs/tasks/v1/tasks.py +++ b/openedx/core/djangoapps/programs/tasks/v1/tasks.py @@ -171,6 +171,7 @@ def award_program_certificates(self, username): if not program_ids: # Again, no reason to continue beyond this point unless/until this # task gets updated to support revocation of program certs. + LOGGER.info('Task award_program_certificates was called for user %s with no completed programs', username) return # Determine which program certificates the user has already been @@ -213,5 +214,7 @@ def award_program_certificates(self, username): # N.B. This logic assumes that this task is idempotent LOGGER.info('Retrying task to award failed certificates to user %s', username) raise self.retry(countdown=countdown, max_retries=config.max_retries) + else: + LOGGER.info('User %s is not eligible for any new program certificates', username) LOGGER.info('Successfully completed the task award_program_certificates for username %s', username)