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): ...@@ -51,8 +51,7 @@ class Command(BaseCommand):
raise raise
total = len(uuids) total = len(uuids)
logger.info('Caching UUIDs for {total} programs.'.format(total=total)) logger.info('Received {total} UUIDs.'.format(total=total))
cache.set(PROGRAM_UUIDS_CACHE_KEY, uuids, None)
programs = {} programs = {}
failure = False failure = False
...@@ -73,12 +72,8 @@ class Command(BaseCommand): ...@@ -73,12 +72,8 @@ class Command(BaseCommand):
logger.info('Caching details for {successful} programs.'.format(successful=successful)) logger.info('Caching details for {successful} programs.'.format(successful=successful))
cache.set_many(programs, None) cache.set_many(programs, None)
logger.info( logger.info('Caching UUIDs for {total} programs.'.format(total=total))
'Program caching complete. Successfully cached {successful} of {total} programs.'.format( cache.set(PROGRAM_UUIDS_CACHE_KEY, uuids, None)
successful=successful,
total=total
)
)
if failure: if failure:
# This will fail a Jenkins job running this command, letting site # 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