Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
fredriklindberg committed Jan 4, 2024
1 parent 2da9315 commit d946a5c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/cluster/cluster-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ class ClusterManager {
this._bus = <any>undefined;
}

public static isMultinode(): boolean {
return this.multiNode;
}

public static async setReady(ready: boolean = true): Promise<boolean> {
if (!ready) {
clearInterval(this._heartbeat);
Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export default async (argv) => {
process.exit(-1);
});

await ClusterManager.setReady();
await ClusterManager.setReady(true);
adminController.setReady();
logger.info("exposrd ready");

Expand All @@ -200,13 +200,13 @@ export default async (argv) => {

let result;
try {
const multiNode = ClusterManager.setReady(false);
ClusterManager.setReady(false);
adminController.setReady(false);

// Drain and block new tunnel connections
await Promise.race([TunnelConnectionManager.stop() , timeout, force]);

if (multiNode) {
if (ClusterManager.isMultinode()) {
logger.info("Waiting for connections to drain...");
await Promise.race([new Promise((resolve) => {
setTimeout(resolve, drainTimeout);
Expand Down

0 comments on commit d946a5c

Please sign in to comment.