orchestrator changes

This commit is contained in:
Ishaan Dey
2024-05-13 14:32:15 -07:00
parent aef8105bb0
commit eb629835d2
7 changed files with 879 additions and 4 deletions

View File

@ -418,6 +418,7 @@ io.on("connection", async (socket) => {
)
socket.on("disconnect", async () => {
console.log("disconnected", data.userId, data.sandboxId)
if (data.isOwner) {
// console.log("deleting all terminals")
Object.entries(terminals).forEach((t) => {
@ -445,11 +446,13 @@ io.on("connection", async (socket) => {
}
});
}, 20000);
} else {
console.log("number of sockets", sockets.length)
}
})
})
httpServer.listen(port, () => {
console.log(`Server running on port ${port}`)
console.log(`Server, running on port ${port}`)
})

View File

@ -198,7 +198,7 @@ ${code}`,
}
export const stopServer = async (sandboxId: string, userId: string) => {
const res = await fetch("http://localhost:4001/stop", {
const res = await fetch("https://sylvan-epoch-422219-f9.uc.r.appspot.com/stop", {
method: "POST",
headers: {
"Content-Type": "application/json",