Update py
This commit is contained in:
4
main.py
4
main.py
@@ -2795,7 +2795,7 @@ class Run_Simulation_Manually_by_Date(BaseModel):
|
||||
name: str
|
||||
simulation_date: str
|
||||
|
||||
def run_simulation_manually_by_date(network_name: str, simulation_date: str) -> None:
|
||||
def run_simulation_manually_by_date(network_name: str, base_date: datetime) -> None:
|
||||
# 循环生成96个时间点(15分钟间隔)
|
||||
for i in range(96):
|
||||
# 计算当前时间偏移
|
||||
@@ -2842,7 +2842,7 @@ async def fastapi_run_simulation_manually_by_date(data: Run_Simulation_Manually_
|
||||
|
||||
base_date = datetime.strptime(item['simulation_date'], "%Y-%m-%d")
|
||||
|
||||
thread = threading.Thread(target=lambda: run_simulation_manually_by_date(item['name'], item['simulation_date']))
|
||||
thread = threading.Thread(target=lambda: run_simulation_manually_by_date(item['name'], base_date))
|
||||
thread.start()
|
||||
|
||||
############################################################
|
||||
|
||||
Reference in New Issue
Block a user