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

Sending timeout when available in the handshake response #860

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from
Open
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
10 changes: 9 additions & 1 deletion lib/connectors/commands/handshake.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ var Command = function(opts) {
this.heartbeat = opts.heartbeat * 1000;
}

if(opts.timeout){
this.timeout = opts.timeout;
}

this.checkClient = opts.checkClient;

this.useDict = opts.useDict;
Expand All @@ -44,6 +48,10 @@ Command.prototype.handle = function(socket, msg) {
heartbeat : setupHeartbeat(this)
};

if(this.timeout){
opts.timeout = this.timeout;
}

if(this.useDict) {
var dictVersion = pomelo.app.components.__dictionary__.getVersion();
if(!msg.sys.dictVersion || msg.sys.dictVersion !== dictVersion){
Expand All @@ -53,7 +61,7 @@ Command.prototype.handle = function(socket, msg) {

opts.routeToCode = pomelo.app.components.__dictionary__.getDict();
opts.codeToRoute = pomelo.app.components.__dictionary__.getAbbrs();
opts.dictVersion = dictVersion;
opts.dictVersion = dictVersion;
}
opts.useDict = true;
}
Expand Down