fix(dokploy): prevent to have pending connections docker logs

This commit is contained in:
Mauricio Siu
2024-10-27 14:12:45 -06:00
parent 3808fd83a6
commit 3f40ad3250
2 changed files with 29 additions and 17 deletions

View File

@@ -43,6 +43,15 @@ export const setupDockerContainerLogsWebSocketServer = (
ws.close();
return;
}
const pingInterval = setInterval(() => {
if (ws.readyState === ws.OPEN) {
ws.ping();
}
}, 30000);
ws.on("close", () => clearInterval(pingInterval));
try {
if (serverId) {
const server = await findServerById(serverId);