querysub 0.295.0 → 0.296.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -357,6 +357,8 @@ const runScreenCommand = measureWrap(async function runScreenCommand(config: {
|
|
|
357
357
|
} catch (e: any) {
|
|
358
358
|
console.warn(`Error triggering rolling update notification to ${nodeId} for ${screenName}: ${e.stack}`);
|
|
359
359
|
}
|
|
360
|
+
} else {
|
|
361
|
+
console.log(red(`No nodeId file found for ${screenName}, not triggering rolling update notification`));
|
|
360
362
|
}
|
|
361
363
|
let rollingScreenName = screenName + "-rolling" + SCREEN_SUFFIX;
|
|
362
364
|
console.log(green(`Renaming screen ${screenName} to ${rollingScreenName} for rolling interval ${config.rollingWindow} at ${new Date().toLocaleString()}`));
|
|
@@ -22,6 +22,7 @@ import { isNode } from "typesafecss";
|
|
|
22
22
|
import { DeployProgress, deployFunctions, deployGetFunctions } from "../4-deploy/deployFunctions";
|
|
23
23
|
import { FunctionSpec, functionSchema } from "../3-path-functions/PathFunctionRunner";
|
|
24
24
|
import { Querysub } from "../4-querysub/QuerysubController";
|
|
25
|
+
import { green, red } from "socket-function/src/formatting/logColors";
|
|
25
26
|
|
|
26
27
|
const SERVICE_FOLDER_NAME = "machine-services";
|
|
27
28
|
export const SERVICE_FOLDER = `${SERVICE_FOLDER_NAME}/`;
|
|
@@ -101,7 +102,11 @@ async function registerNodeForMachineCleanup(nodeId: string) {
|
|
|
101
102
|
let currentPath = path.resolve(".").replaceAll("\\", "/");
|
|
102
103
|
let array = currentPath.split("/");
|
|
103
104
|
if (array.at(-1) === "git" && array.at(-2) === SERVICE_FOLDER_NAME) {
|
|
104
|
-
|
|
105
|
+
let nodeIdPath = array.slice(0, -1).join("/") + "/" + SERVICE_NODE_FILE_NAME;
|
|
106
|
+
console.log(green(`Registering node for machine cleanup at ${nodeIdPath}`));
|
|
107
|
+
await fs.promises.writeFile(nodeIdPath, nodeId);
|
|
108
|
+
} else {
|
|
109
|
+
console.log(red(`Not registering node for machine cleanup because we are not in the service folder: ${currentPath}`));
|
|
105
110
|
}
|
|
106
111
|
}
|
|
107
112
|
|