From 38076981850eefb24455d904edd2bbba379ecb3a Mon Sep 17 00:00:00 2001 From: Jesse Zong Date: Sun, 7 Sep 2025 15:23:25 -0400 Subject: [PATCH 1/2] Fix flushing --- scripts/flush_db.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/flush_db.py b/scripts/flush_db.py index 68d45e6..2700b3e 100644 --- a/scripts/flush_db.py +++ b/scripts/flush_db.py @@ -34,12 +34,12 @@ async def main(): async for key in items: try: data_bytes = await redis.get(key) - data = data_bytes.decode("utf-8").replace("'", '"') - json_string = json.dumps(data) - data = json.loads(json.loads(json_string)) + data_str = data_bytes.decode("utf-8") + data = json.loads(data_str) except ValueError as e: - print(e) print("flush_db: invalid key") + print(data_bytes.decode("utf-8").replace("'", '"')) + print(e) continue events.append( From cd4a78cd024971463e7b157ba28ae0999eb39a76 Mon Sep 17 00:00:00 2001 From: Jesse Zong Date: Sun, 7 Sep 2025 15:25:31 -0400 Subject: [PATCH 2/2] Cleanup error printing --- scripts/flush_db.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/flush_db.py b/scripts/flush_db.py index 2700b3e..32231cc 100644 --- a/scripts/flush_db.py +++ b/scripts/flush_db.py @@ -38,7 +38,6 @@ async def main(): data = json.loads(data_str) except ValueError as e: print("flush_db: invalid key") - print(data_bytes.decode("utf-8").replace("'", '"')) print(e) continue