diff --git a/server/model/monitor.js b/server/model/monitor.js index 663f01d6f..079174124 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -740,7 +740,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 3c382b714..4ddb6ce35 100644 --- a/server/util-server.js +++ b/server/util-server.js @@ -378,6 +378,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 ( @@ -388,10 +389,12 @@ exports.radius = function ( callingStationId, secret, port = 1812, + timeout = 2500, ) { const client = new radiusClient({ host: hostname, hostPort: port, + timeout: timeout, dictionaries: [ file ], });