mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2026-11-25 23:16:18 +01:00
fix: return only completed optimization results per run
This commit is contained in:
@@ -2197,7 +2197,7 @@ async def fastapi_optimize(
|
||||
start_datetime = to_datetime().set(hour=start_hour)
|
||||
|
||||
# Ensure there is only one optimization/ energy management run at a time
|
||||
await get_ems().run(
|
||||
solution = await get_ems().run(
|
||||
start_datetime=start_datetime,
|
||||
mode=EnergyManagementMode.OPTIMIZATION,
|
||||
algorithm=OptimizationAlgorithm.GENETIC0,
|
||||
@@ -2205,7 +2205,6 @@ async def fastapi_optimize(
|
||||
genetic0_generations=ngen,
|
||||
)
|
||||
|
||||
solution = get_ems().genetic0_solution()
|
||||
if solution is None:
|
||||
raise EOSProblem(
|
||||
status=404,
|
||||
|
||||
Reference in New Issue
Block a user