From f1a396b0f7b1e775cf88f0b768e21f3c56b3bf43 Mon Sep 17 00:00:00 2001 From: Nelson Chan Date: Tue, 23 May 2023 18:18:54 +0800 Subject: [PATCH] Fix: Align radius timeout to default --- server/model/monitor.js | 3 ++- server/util-server.js | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index b5e58c57..20e7a0af 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -671,7 +671,8 @@ class Monitor extends BeanModel { this.radiusCalledStationId, this.radiusCallingStationId, this.radiusSecret, - port + port, + this.interval * 1000 * 0.8, ); if (resp.code) { bean.msg = resp.code; diff --git a/server/util-server.js b/server/util-server.js index 47f6bb48..5dabb7bf 100644 --- a/server/util-server.js +++ b/server/util-server.js @@ -373,6 +373,7 @@ exports.mongodbPing = async function (connectionString) { * @param {string} callingStationId ID of calling station * @param {string} secret Secret to use * @param {number} [port=1812] Port to contact radius server on + * @param {number} [timeout=2500] Timeout for connection to use * @returns {Promise} */ exports.radius = function ( @@ -383,10 +384,12 @@ exports.radius = function ( callingStationId, secret, port = 1812, + timeout = 2500, ) { const client = new radiusClient({ host: hostname, hostPort: port, + timeout: timeout, dictionaries: [ file ], });