From 0f471a190301476c5b3a274583222a636792610b Mon Sep 17 00:00:00 2001 From: DingZQ Date: Mon, 2 Jun 2025 19:09:53 +0800 Subject: [PATCH] Clear redis after we force mamually run simulation --- main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 3b2cf9b..bc16fb2 100644 --- a/main.py +++ b/main.py @@ -2845,8 +2845,13 @@ async def fastapi_run_simulation_manually_by_date(data: Run_Simulation_Manually_ thread = threading.Thread(target=lambda: run_simulation_manually_by_date(item['name'], base_date)) thread.start() + thread.join() + matched_keys = redis_client.keys(f"*{item['simulation_date']}*") + redis_client.delete(*matched_keys) + + ############################################################ -# real_time api 37.5 +# real_Time api 37.5 # example: # response = requests.post("http://127.0.0.1:8000/runsimulation", # data=json.dumps({'network': 'bb_server', 'simulation_type': 'extended',