Commit 08dcbace by Renzo Lucioni

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
parent 37eba6ac
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment