aboutsummaryrefslogtreecommitdiff
path: root/src/server/DashSession/Session/agents/applied_session_agent.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-12-04 17:38:36 -0500
committerbobzel <zzzman@gmail.com>2023-12-04 17:38:36 -0500
commit2bd239e39264a362d1fbb013ce2613d03247d78e (patch)
tree6e537dc0c35529c6ee27758a4dec03e23210dbc6 /src/server/DashSession/Session/agents/applied_session_agent.ts
parentcf7a7dc34426dacf018ac98a83a9589106ae7256 (diff)
trying to do version updates on all npm packages.
Diffstat (limited to 'src/server/DashSession/Session/agents/applied_session_agent.ts')
-rw-r--r--src/server/DashSession/Session/agents/applied_session_agent.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/server/DashSession/Session/agents/applied_session_agent.ts b/src/server/DashSession/Session/agents/applied_session_agent.ts
index 8339a06dc..2037e93e5 100644
--- a/src/server/DashSession/Session/agents/applied_session_agent.ts
+++ b/src/server/DashSession/Session/agents/applied_session_agent.ts
@@ -1,7 +1,8 @@
-import { isMaster } from "cluster";
+import * as _cluster from "cluster";
import { Monitor } from "./monitor";
import { ServerWorker } from "./server_worker";
-import { Utilities } from "../utilities/utilities";
+const cluster = _cluster as any;
+const isMaster = cluster.isPrimary;
export type ExitHandler = (reason: Error | boolean) => void | Promise<void>;
@@ -15,13 +16,13 @@ export abstract class AppliedSessionAgent {
private launched = false;
public killSession = (reason: string, graceful = true, errorCode = 0) => {
- const target = isMaster ? this.sessionMonitor : this.serverWorker;
+ const target = cluster.default.isPrimary ? this.sessionMonitor : this.serverWorker;
target.killSession(reason, graceful, errorCode);
}
private sessionMonitorRef: Monitor | undefined;
public get sessionMonitor(): Monitor {
- if (!isMaster) {
+ if (!cluster.default.isPrimary) {
this.serverWorker.emit("kill", {
graceful: false,
reason: "Cannot access the session monitor directly from the server worker thread.",