diff --git a/src/everest/detached/jobs/everserver.py b/src/everest/detached/jobs/everserver.py index 8ad8a508fc9..39d3dcf62b7 100755 --- a/src/everest/detached/jobs/everserver.py +++ b/src/everest/detached/jobs/everserver.py @@ -377,20 +377,21 @@ async def everserver_main(): event = jsonable_encoder(item) shared_data["events"].append(event) - for sub in shared_data["subscribers"]: + for sub in shared_data["subscribers"].values(): sub.notify() await asyncio.sleep(0.1) if isinstance(item, EndEvent): events.append(EndTaskEvent()) - for sub in shared_data["subscribers"]: + for sub in shared_data["subscribers"].values(): sub.notify() break await simulation_future - run_model = None status, message = _get_optimization_status(run_model.exit_code, shared_data) + run_model = None + if status != ServerStatus.completed: update_everserver_status(status_path, status, message) return