Skip to content

Commit

Permalink
only destroy runtime if no one is active
Browse files Browse the repository at this point in the history
  • Loading branch information
rbren committed Dec 24, 2024
1 parent 30c1d03 commit 9a6084c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openhands/server/session/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ async def _cleanup_session_later(self, sid: str):
async def _cleanup_session(self, sid: str) -> bool:
# Get local connections
logger.info(f'_cleanup_session:{sid}')
await call_sync_from_async(runtime_manager.destroy_runtime, sid)
has_local_connections = next(
(True for v in self.local_connection_id_to_session_id.values() if v == sid),
False,
Expand All @@ -313,6 +312,7 @@ async def _cleanup_session(self, sid: str) -> bool:
if redis_client and await self._has_remote_connections(sid):
return False

await call_sync_from_async(runtime_manager.destroy_runtime, sid)
# We alert the cluster in case they are interested
if redis_client:
await redis_client.publish(
Expand Down

0 comments on commit 9a6084c

Please sign in to comment.