Clear redis after we force mamually run simulation

This commit is contained in:
DingZQ
2025-06-02 19:09:53 +08:00
parent 70affaa182
commit 0f471a1903

View File

@@ -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 = threading.Thread(target=lambda: run_simulation_manually_by_date(item['name'], base_date))
thread.start() 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: # example:
# response = requests.post("http://127.0.0.1:8000/runsimulation", # response = requests.post("http://127.0.0.1:8000/runsimulation",
# data=json.dumps({'network': 'bb_server', 'simulation_type': 'extended', # data=json.dumps({'network': 'bb_server', 'simulation_type': 'extended',