Skip to content

Commit

Permalink
fix: wait for node to wake up before starting lifeline healthcheck (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone authored Mar 15, 2022
1 parent 720b491 commit 67d78fc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/zwave-js/src/lib/node/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3955,6 +3955,15 @@ protocol version: ${this.protocolVersion}`;
})...`,
);

if (this.canSleep && this.status !== NodeStatus.Awake) {
// Wait for node to wake up to avoid incorrectly long delays in the first health check round
this.driver.controllerLog.logNode(
this.id,
`waiting for node to wake up...`,
);
await this.waitForWakeup();
}

const results: LifelineHealthCheckResult[] = [];
for (let round = 1; round <= rounds; round++) {
// Determine the number of repeating neighbors
Expand All @@ -3975,6 +3984,7 @@ protocol version: ${this.protocolVersion}`;
txReport = report;
},
});

for (let i = 1; i <= healthCheckTestFrameCount; i++) {
const start = Date.now();
const pingResult = await pingAPI.send().then(
Expand Down

0 comments on commit 67d78fc

Please sign in to comment.