Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

#814 fix heartbeat bug #815

Merged
merged 1 commit into from
Jan 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/connectors/commands/heartbeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ var Command = function(opts) {
opts = opts || {};
this.heartbeat = null;
this.timeout = null;
this.disconnectOnTimeout = opts.disconnectOnTimeout;

if(opts.heartbeat) {
this.heartbeat = opts.heartbeat * 1000; // heartbeat interval
this.timeout = opts.timeout * 1000 || this.heartbeat * 2; // max heartbeat message timeout
this.disconnectOnTimeout = true;
}

this.timeouts = {};
this.clients = {};
this.disconnectOnTimeout = opts.disconnectOnTimeout;
};

module.exports = Command;
Expand Down