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