Skip to content

Commit

Permalink
Fix agent session error in logs (#4669)
Browse files Browse the repository at this point in the history
  • Loading branch information
tofarr authored Nov 1, 2024
1 parent dd55290 commit 6414b1a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion openhands/server/session/agent_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,13 @@ async def close(self):
await self.security_analyzer.close()

if self.loop:
self.loop.stop()
if self.loop.is_closed():
logger.debug(
'Trying to close already closed loop. (It probably never started correctly)'
)
else:
self.loop.stop()
self.loop = None

self._closed = True

Expand Down

0 comments on commit 6414b1a

Please sign in to comment.