Fix connection timeout being set incorrectly

This commit is contained in:
Zaid Abdulla committed 2020-10-18 12:52:01 -07:00
1 parent 9f4b421b59
commit 62849e8081
6 files changed
+69 -43

No files matched your search

+11 -11
View File
@@ -77,9 +77,16 @@ if (!cluster.worker) {
cluster.stop();
});
} else {
const ssl = {
key: config.get("CWMP_SSL_KEY") as string,
cert: config.get("CWMP_SSL_CERT") as string,
const key = config.get("CWMP_SSL_KEY") as string;
const cert = config.get("CWMP_SSL_CERT") as string;
const options = {
port: SERVICE_PORT,
host: SERVICE_ADDRESS,
ssl: key && cert ? { key, cert } : null,
onConnection: cwmp.onConnection,
timeout: 30000,
keepAliveTimeout: 0,
};
process.on("uncaughtException", (err) => {
@@ -94,14 +101,7 @@ if (!cluster.worker) {
const initPromise = Promise.all([db.connect(), cache.connect()])
.then(() => {
server.start(
SERVICE_PORT,
SERVICE_ADDRESS,
ssl,
cwmp.listener,
cwmp.onConnection,
0
);
server.start(options, cwmp.listener);
})
.catch((err) => {
setTimeout(() => {
+8 -4
View File
@@ -73,9 +73,13 @@ if (!cluster.worker) {
cluster.stop();
});
} else {
const ssl = {
key: config.get("FS_SSL_KEY") as string,
cert: config.get("FS_SSL_CERT") as string,
const key = config.get("FS_SSL_KEY") as string;
const cert = config.get("FS_SSL_CERT") as string;
const options = {
port: SERVICE_PORT,
host: SERVICE_ADDRESS,
ssl: key && cert ? { key, cert } : null,
timeout: 30000,
};
let stopping = false;
@@ -98,7 +102,7 @@ if (!cluster.worker) {
const initPromise = Promise.all([db.connect(), cache.connect()])
.then(() => {
server.start(SERVICE_PORT, SERVICE_ADDRESS, ssl, _listener);
server.start(options, _listener);
})
.catch((err) => {
setTimeout(() => {
+8 -4
View File
@@ -77,9 +77,13 @@ if (!cluster.worker) {
cluster.stop();
});
} else {
const ssl = {
key: config.get("NBI_SSL_KEY") as string,
cert: config.get("NBI_SSL_CERT") as string,
const key = config.get("NBI_SSL_KEY") as string;
const cert = config.get("NBI_SSL_CERT") as string;
const options = {
port: SERVICE_PORT,
host: SERVICE_ADDRESS,
ssl: key && cert ? { key, cert } : null,
timeout: 30000,
};
let stopping = false;
@@ -102,7 +106,7 @@ if (!cluster.worker) {
const initPromise = Promise.all([db.connect(), cache.connect()])
.then(() => {
server.start(SERVICE_PORT, SERVICE_ADDRESS, ssl, _listener);
server.start(options, _listener);
})
.catch((err) => {
setTimeout(() => {
+8 -4
View File
@@ -79,9 +79,13 @@ if (!cluster.worker) {
cluster.stop();
});
} else {
const ssl = {
key: config.get("UI_SSL_KEY") as string,
cert: config.get("UI_SSL_CERT") as string,
const key = config.get("UI_SSL_KEY") as string;
const cert = config.get("UI_SSL_CERT") as string;
const options = {
port: SERVICE_PORT,
host: SERVICE_ADDRESS,
ssl: key && cert ? { key, cert } : null,
timeout: 30000,
};
let stopping = false;
@@ -106,7 +110,7 @@ if (!cluster.worker) {
const initPromise = Promise.all([db2.connect(), cache.connect()])
.then(() => {
server.start(SERVICE_PORT, SERVICE_ADDRESS, ssl, _listener);
server.start(options, _listener);
})
.catch((err) => {
setTimeout(() => {