Skip to content

Commit

Permalink
log corr
Browse files Browse the repository at this point in the history
  • Loading branch information
arteck authored Mar 25, 2024
1 parent 776160e commit 5c4a33a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/mqtt-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,9 @@ class MqttServer {
if (!lastTimeActive)
return;
const diff = Date.now() - lastTimeActive;
if (diff > 70000) {
if (diff > interval ) {
this.adapter.log.debug(`[MQTT] ${ipMsg} NOT ALIVE - last contact ${Math.round(diff / 1000)}s (${diff}ms) ago`);
this.setIsAlive(clientId, false, 'client did not send message for more than 70 seconds');
this.setIsAlive(clientId, false, 'client did not send message for more than ' + this.adapter.config.mqttTimeout + ' seconds');
} else {
this.adapter.log.warn(`[MQTT] ${ipMsg} This should never happen: scheduleCheckIfStillActive() timeout, and last contact was less than ${this.adapter.config.mqttTimeout} sec ago.`);
this.adapter.log.warn(`[MQTT] ${ipMsg} is alive - last contact ${Math.round(diff / 1000)}s (${diff}ms) ago`);
Expand Down

0 comments on commit 5c4a33a

Please sign in to comment.