querysub 0.574.0 → 0.575.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/appSecrets.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { lazy } from "socket-function/src/caching";
|
|
|
3
3
|
import { ArchivesBackblaze } from "sliftutils/storage/backblaze";
|
|
4
4
|
import { STORAGE_DIR, getDomain, getBackblazePath } from "./src/misc/appPaths";
|
|
5
5
|
import { Querysub } from "./src/4-querysub/Querysub";
|
|
6
|
+
import { formatDateTime } from "socket-function/src/formatting/format";
|
|
6
7
|
|
|
7
8
|
const keysArchives = lazy(() => new ArchivesBackblaze({ bucketName: getDomain() }));
|
|
8
9
|
|
|
@@ -55,7 +56,7 @@ let doImmediateShutdown = lazy(() => {
|
|
|
55
56
|
});
|
|
56
57
|
}
|
|
57
58
|
function doShutdown() {
|
|
58
|
-
console.log(
|
|
59
|
+
console.log(`SIGINT received, shutting down immediately (${formatDateTime(Date.now())})`);
|
|
59
60
|
process.exit();
|
|
60
61
|
}
|
|
61
62
|
process.on("SIGINT", doShutdown);
|
package/package.json
CHANGED
|
@@ -347,6 +347,8 @@ export async function retireCurrentScreen(config: {
|
|
|
347
347
|
// The file in the folder belongs to its replacement now, so only the registration goes
|
|
348
348
|
void removeServiceNode({ folder, nodeId, ownsFile: false });
|
|
349
349
|
}
|
|
350
|
+
// Started here rather than waiting for a resync to notice the screen: with a killTime already past - a zero overlap - this takes it down right now
|
|
351
|
+
void retireScreen(retiringScreenName);
|
|
350
352
|
}
|
|
351
353
|
|
|
352
354
|
/** Ends a session at once, with no notice - for a screen that should not exist at all, so there is nothing to wind down gracefully. Finding one is always a surprise, so the reason it was not supposed to be there is logged. */
|
|
@@ -363,7 +365,7 @@ export const killScreen = measureWrap(async function killScreen(config: {
|
|
|
363
365
|
console.log(red(`Killing screen ${config.screenName} (Ctrl+C, then killing the session in ${formatTime(SHUTDOWN_GRACE_TIME)})`));
|
|
364
366
|
let prefix = getTmuxPrefix();
|
|
365
367
|
// Purely a notice to the process that it is going away, so it can wind down. We never check whether it worked and we never reuse the screen - the session is killed either way.
|
|
366
|
-
|
|
368
|
+
void runPromise(`${prefix}tmux send-keys -t ${config.screenName} 'C-c' Enter`);
|
|
367
369
|
await delay(SHUTDOWN_GRACE_TIME);
|
|
368
370
|
await runPromise(`${prefix}tmux kill-session -t ${config.screenName}`);
|
|
369
371
|
});
|