mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
Run runtime.close in background thread (#7524)
This commit is contained in:
parent
400afeb70e
commit
c5491e87aa
@ -24,7 +24,7 @@ from openhands.runtime.base import Runtime
|
||||
from openhands.runtime.impl.remote.remote_runtime import RemoteRuntime
|
||||
from openhands.security import SecurityAnalyzer, options
|
||||
from openhands.storage.files import FileStore
|
||||
from openhands.utils.async_utils import call_sync_from_async
|
||||
from openhands.utils.async_utils import EXECUTOR, call_sync_from_async
|
||||
from openhands.utils.shutdown_listener import should_continue
|
||||
|
||||
WAIT_TIME_BEFORE_CLOSE = 90
|
||||
@ -203,7 +203,7 @@ class AgentSession:
|
||||
end_state.save_to_session(self.sid, self.file_store, self.user_id)
|
||||
await self.controller.close()
|
||||
if self.runtime is not None:
|
||||
self.runtime.close()
|
||||
EXECUTOR.submit(self.runtime.close)
|
||||
if self.security_analyzer is not None:
|
||||
await self.security_analyzer.close()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user