refactor: remove console log statements on WebSocket connection close and adjust compose file handling based on source type

This commit is contained in:
Mauricio Siu
2025-03-15 18:36:40 -06:00
parent bbe7d5bdc5
commit fa954c3bbd
2 changed files with 8 additions and 6 deletions

View File

@@ -61,7 +61,6 @@ export const setupDeploymentLogsWebSocketServer = (
} }
stream stream
.on("close", () => { .on("close", () => {
console.log("Connection closed ✅");
client.end(); client.end();
ws.close(); ws.close();
}) })
@@ -86,7 +85,6 @@ export const setupDeploymentLogsWebSocketServer = (
}); });
ws.on("close", () => { ws.on("close", () => {
console.log("Connection closed ✅, From WS");
client.end(); client.end();
}); });
} else { } else {

View File

@@ -289,11 +289,11 @@ export const rebuildCompose = async ({
// if (admin.cleanupCacheOnCompose) { // if (admin.cleanupCacheOnCompose) {
// await cleanupFullDocker(compose?.serverId); // await cleanupFullDocker(compose?.serverId);
// } // }
if (compose.serverId) {
await getBuildComposeCommand(compose, deployment.logPath); if (compose.sourceType === "raw") {
} else { await createComposeFile(compose, deployment.logPath);
await buildCompose(compose, deployment.logPath);
} }
await buildCompose(compose, deployment.logPath);
await updateDeploymentStatus(deployment.deploymentId, "done"); await updateDeploymentStatus(deployment.deploymentId, "done");
await updateCompose(composeId, { await updateCompose(composeId, {
@@ -433,6 +433,10 @@ export const rebuildRemoteCompose = async ({
// if (admin.cleanupCacheOnCompose) { // if (admin.cleanupCacheOnCompose) {
// await cleanupFullDocker(compose?.serverId); // await cleanupFullDocker(compose?.serverId);
// } // }
if (compose.sourceType === "raw") {
const command = getCreateComposeFileCommand(compose, deployment.logPath);
await execAsyncRemote(compose.serverId, command);
}
if (compose.serverId) { if (compose.serverId) {
await getBuildComposeCommand(compose, deployment.logPath); await getBuildComposeCommand(compose, deployment.logPath);
} }