fix: wait until terminals are killed to close the container
This commit is contained in:
parent
e3b2d882dd
commit
3c4850ee72
@ -432,11 +432,12 @@ io.on("connection", async (socket) => {
|
||||
|
||||
socket.on("disconnect", async () => {
|
||||
if (data.isOwner) {
|
||||
Object.entries(terminals).forEach((t) => {
|
||||
const terminal = t[1];
|
||||
terminal.kill();
|
||||
delete terminals[t[0]];
|
||||
});
|
||||
await Promise.all(
|
||||
Object.entries(terminals).map(async ([key, terminal]) => {
|
||||
await terminal.kill();
|
||||
delete terminals[key];
|
||||
})
|
||||
);
|
||||
|
||||
await lockManager.acquireLock(data.sandboxId, async () => {
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user