From e2b5a27ff9b83d2fdc6989e0d72b7e41010ea876 Mon Sep 17 00:00:00 2001
From: Carsten Hinz <c.hinz@fz-juelich.de>
Date: Wed, 8 May 2024 14:04:02 +0200
Subject: [PATCH] changed layout of backup cache as the endpoint should be more
 unique

---
 toargridding/toar_rest_client.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/toargridding/toar_rest_client.py b/toargridding/toar_rest_client.py
index cfa30d7..607dd0f 100644
--- a/toargridding/toar_rest_client.py
+++ b/toargridding/toar_rest_client.py
@@ -217,9 +217,10 @@ class Connection:
                 print("Status Code: {e.response.status_code}")
                 print("Reason: {e.response.reason}")
                 print("Text: {e.response.text}")
+                #use inverse order for saving. the status endpoint should be more unique
+                self.cache_backup.put(status_endpoint, query_options.cache_key)
                 #will be overwritten in the next step...
-                self.cache_backup.put(query_options.cache_key, status_endpoint)
-                self.cache.remove(query_options.cache_key)
+                #self.cache.remove(query_options.cache_key)
             except:
                 raise RuntimeError(f"An error occurred during accessing a cached request")
             else:
-- 
GitLab