From 67d7155e42041a0e1f9ff0c3bcc0e6c4f16d7ddc Mon Sep 17 00:00:00 2001
From: Jorrit Schaap <schaap@astron.nl>
Date: Tue, 15 Mar 2022 14:52:41 +0100
Subject: [PATCH] TMSS-1546: fix

---
 LCS/PyCommon/json_utils.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/LCS/PyCommon/json_utils.py b/LCS/PyCommon/json_utils.py
index 91e7b3468b8..0c8c4810ed4 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:
-- 
GitLab