Clear redis after we force mamually run simulation
This commit is contained in:
7
main.py
7
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 = 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',
|
||||||
|
|||||||
Reference in New Issue
Block a user