mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
Wait for nested container graceful shutdown (#8969)
This commit is contained in:
parent
617445d5ca
commit
0221f21c12
@ -295,6 +295,14 @@ class DockerNestedConversationManager(ConversationManager):
|
||||
) as client:
|
||||
response = await client.post(f'{nested_url}/api/conversations/{sid}/stop')
|
||||
response.raise_for_status()
|
||||
|
||||
# Check up to 3 times that client has closed
|
||||
for _ in range(3):
|
||||
response = await client.get(f'{nested_url}/api/conversations/{sid}')
|
||||
if response.status_code == status.HTTP_200_OK and response.json().get('status') == "STOPPED":
|
||||
break
|
||||
await asyncio.sleep(1)
|
||||
|
||||
except Exception:
|
||||
logger.exception("error_stopping_container")
|
||||
container.stop()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user