From 08dcbace0f9fbeecb4da46fb5d2b4d006ff93e4e Mon Sep 17 00:00:00 2001 From: Renzo Lucioni Date: Fri, 5 May 2017 13:02:45 -0400 Subject: [PATCH] Cache program UUIDs after caching details This prevents the LMS from requesting details for programs which the command hasn't been able to cache yet, which would throw off monitoring we'll be setting up to keep an eye on missing entries. LEARNER-382 --- .../catalog/management/commands/cache_programs.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/openedx/core/djangoapps/catalog/management/commands/cache_programs.py b/openedx/core/djangoapps/catalog/management/commands/cache_programs.py index eeb34d42c3..b2e05b2951 100644 --- a/openedx/core/djangoapps/catalog/management/commands/cache_programs.py +++ b/openedx/core/djangoapps/catalog/management/commands/cache_programs.py @@ -51,8 +51,7 @@ class Command(BaseCommand): raise total = len(uuids) - logger.info('Caching UUIDs for {total} programs.'.format(total=total)) - cache.set(PROGRAM_UUIDS_CACHE_KEY, uuids, None) + logger.info('Received {total} UUIDs.'.format(total=total)) programs = {} failure = False @@ -73,12 +72,8 @@ class Command(BaseCommand): logger.info('Caching details for {successful} programs.'.format(successful=successful)) cache.set_many(programs, None) - logger.info( - 'Program caching complete. Successfully cached {successful} of {total} programs.'.format( - successful=successful, - total=total - ) - ) + logger.info('Caching UUIDs for {total} programs.'.format(total=total)) + cache.set(PROGRAM_UUIDS_CACHE_KEY, uuids, None) if failure: # This will fail a Jenkins job running this command, letting site