From 395c1064cf87950d82f6a768c88af76be866ff1d Mon Sep 17 00:00:00 2001 From: Hari Krishna Date: Thu, 16 Oct 2025 08:03:48 +0000 Subject: [PATCH] feat: add existence check for keys in cache --- shuffle-tools/1.2.0/src/app.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/shuffle-tools/1.2.0/src/app.py b/shuffle-tools/1.2.0/src/app.py index c99aa240..83949ade 100644 --- a/shuffle-tools/1.2.0/src/app.py +++ b/shuffle-tools/1.2.0/src/app.py @@ -2304,6 +2304,13 @@ def set_cache_value(self, key, value, category=""): allvalues["key"] = key #allvalues["value"] = json.loads(json.dumps(value)) + allvalues["existed"] = False + if "keys_existed" in allvalues: + for key_info in allvalues["keys_existed"]: + if key_info["key"] == key: + allvalues["existed"] = key_info["existed"] + break + if (value.startswith("{") and value.endswith("}")) or (value.startswith("[") and value.endswith("]")): try: allvalues["value"] = json.loads(value)