diff --git a/LCS/PyCommon/json_utils.py b/LCS/PyCommon/json_utils.py index 91e7b3468b8f66f4839365914bcb0f1d56ffa0f5..0c8c4810ed4991a73df4139eaa668d725111570f 100644 --- a/LCS/PyCommon/json_utils.py +++ b/LCS/PyCommon/json_utils.py @@ -290,11 +290,11 @@ def resolved_remote_refs(schema, cache: dict=None, max_cache_age: timedelta=DEFA # alter the original id, and append 'ref_resolved' to it, so it is distinguishable from the orginal non-ref-resolved schema copy_of_schema['$id'] = ref_resolved_url(copy_of_schema['$id']) - if copy_of_schema['$id'] in cache: - # return cached ref_resolved schema if not too old - referenced_schema, last_update_timestamp = cache[copy_of_schema['$id']] - if datetime.utcnow() - last_update_timestamp < max_cache_age: - return referenced_schema + if copy_of_schema['$id'] in cache: + # return cached ref_resolved schema if not too old + referenced_schema, last_update_timestamp = cache[copy_of_schema['$id']] + if datetime.utcnow() - last_update_timestamp < max_cache_age: + return referenced_schema # make sure we have a 'definitions' section if 'definitions' not in copy_of_schema: