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

View File

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