Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes default and minimum reconnection timeout #26

Open
wants to merge 1 commit into
base: develop
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: 5 additions & 5 deletions logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ const uuid = require('uuid/v1');

let RECONNECTION_TIMEOUT = Number(process.env.RECONNECTION_TIMEOUT);
if (Number.isNaN(RECONNECTION_TIMEOUT)) {
// Default value: 24h
RECONNECTION_TIMEOUT = 24 * 60 * 1000;
} else if (RECONNECTION_TIMEOUT < 30000) {
// Minimun value: 30s
// Default value: 30s
RECONNECTION_TIMEOUT = 30000;
} else if (RECONNECTION_TIMEOUT < 5000) {
// Minimun value: 5s
RECONNECTION_TIMEOUT = 5000;
}

const connections = {};
Expand Down Expand Up @@ -306,7 +306,7 @@ exports.create_callback = function create_callback(req, res) {

let buf = '';
req.setEncoding('utf8');
req.on('data', function (chunck) { buf += chunck; });
req.on('data', function (chunk) { buf += chunk; });
req.on('end', function () {
buf = buf.trim();

Expand Down