From 78e5fb4048a19a25506aa003c1b4fd11053f72c8 Mon Sep 17 00:00:00 2001 From: karser Date: Tue, 25 Oct 2022 19:42:21 +0300 Subject: [PATCH] if object references to empty cache then refresh one --- girderformindlogger/models/applet.py | 3 +++ girderformindlogger/utility/jsonld_expander.py | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/girderformindlogger/models/applet.py b/girderformindlogger/models/applet.py index a5d90ef68..becfe1291 100644 --- a/girderformindlogger/models/applet.py +++ b/girderformindlogger/models/applet.py @@ -1924,6 +1924,9 @@ def getNextAppletData(self, activities, nextActivity, bufferSize): activity, 'activity' ) + if not formattedActivity: + print('formattedActivity is empty. ActivityId=' + str(activity['_id'])) + continue buffer['activities'][activityIRI] = formattedActivity['activity'] buffer['items'].update(formattedActivity['items']) diff --git a/girderformindlogger/utility/jsonld_expander.py b/girderformindlogger/utility/jsonld_expander.py index e807f3e59..73dcbea4a 100644 --- a/girderformindlogger/utility/jsonld_expander.py +++ b/girderformindlogger/utility/jsonld_expander.py @@ -1666,7 +1666,12 @@ def formatLdObject( oc is not None ]): if mesoPrefix == 'item' or mesoPrefix == 'screen' or obj.get('meta', {}).get('schema', '') == APPLET_SCHEMA_VERSION: - return(loadCache(oc)) + cached = loadCache(oc) + if cached is not None: + return cached + else: + refreshCache=True + reimportFromUrl=False else: return {}