Skip to content

Commit

Permalink
Fix for error on close
Browse files Browse the repository at this point in the history
  • Loading branch information
tofarr committed Nov 21, 2024
1 parent 8d12295 commit fc400fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions openhands/server/session/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ async def _check_and_close_session(self, session: Session):
redis_client = self._get_redis_client()
if redis_client:
key = _CONNECTION_KEY.format(sid=session.sid)
has_connections_for_session = bool(await redis_client.get(key))
if not has_connections_for_session:
connections_for_session = await redis_client.lrange(key, 0, -1)
testy = await redis_client.get(key+"no_exist")
if not connections_for_session:
await redis_client.delete(key)

# If no connections, close session
Expand Down

0 comments on commit fc400fe

Please sign in to comment.