fix: make SimulateEngine.stop() synchronous

The stop() method was async but called from a sync context,
causing 'RuntimeError: no running event loop'. Changed to sync
since it just sets flags.
This commit is contained in:
shokollm
2026-04-11 17:35:18 +00:00
parent 0d63a10ac8
commit b111e4d79f
2 changed files with 2 additions and 2 deletions

View File

@@ -226,7 +226,7 @@ def stop_simulation(
if run_id in running_simulations:
engine = running_simulations[run_id]
asyncio.create_task(engine.stop())
engine.stop()
simulation.status = "stopped"
db.commit()

View File

@@ -258,7 +258,7 @@ class SimulateEngine:
self.signals.append(signal)
async def stop(self):
def stop(self):
self.running = False
self.status = "stopped"