diff --git a/bbb-webhooks/callback_emitter.js b/bbb-webhooks/callback_emitter.js index 9519c9fad10e4567237314184a6bc1512c24c765..3c22fc2f7527f9db90b4848b24d8884f95df31d5 100644 --- a/bbb-webhooks/callback_emitter.js +++ b/bbb-webhooks/callback_emitter.js @@ -61,10 +61,11 @@ module.exports = class CallbackEmitter extends EventEmitter { } _emitMessage(callback) { - let data,requestOptions; + let data, requestOptions; const serverDomain = config.get("bbb.serverDomain"); const sharedSecret = config.get("bbb.sharedSecret"); const bearerAuth = config.get("bbb.auth2_0"); + const timeout = config.get('hooks.requestTimeout'); // data to be sent // note: keep keys in alphabetical order @@ -85,7 +86,8 @@ module.exports = class CallbackEmitter extends EventEmitter { form: data, auth: { bearer: sharedSecret - } + }, + timeout }; } else { @@ -103,7 +105,8 @@ module.exports = class CallbackEmitter extends EventEmitter { maxRedirects: 10, uri: callbackURL, method: "POST", - form: data + form: data, + timeout }; } diff --git a/bbb-webhooks/config/custom-environment-variables.yml b/bbb-webhooks/config/custom-environment-variables.yml index 69733ad4a7331b065da09cb6ce18164cd99e1cb1..c8dbc2c0504fbd1811ad890eb59af296fdd13f12 100644 --- a/bbb-webhooks/config/custom-environment-variables.yml +++ b/bbb-webhooks/config/custom-environment-variables.yml @@ -6,6 +6,9 @@ hooks: permanentURLs: __name: PERMANENT_HOOKS __format: json + requestTimeout: + __name: REQUEST_TIMEOUT + __format: json redis: host: REDIS_HOST port: REDIS_PORT diff --git a/bbb-webhooks/config/default.example.yml b/bbb-webhooks/config/default.example.yml index 037f3b9ad66f4345f7117d45d9bc56edd73830c0..1ca2983dc88ca1499f2c5751f4eb2b9c07541c6a 100644 --- a/bbb-webhooks/config/default.example.yml +++ b/bbb-webhooks/config/default.example.yml @@ -47,6 +47,8 @@ hooks: - 60000 # Reset permanent interval when exceeding maximum attemps permanentIntervalReset: 8 + # Hook's request module timeout for socket conn establishment and/or responses (ms) + requestTimeout: 5000 # Mappings of internal to external meeting IDs mappings: @@ -64,4 +66,4 @@ redis: mappingPrefix: bigbluebutton:webhooks:mapping eventsPrefix: bigbluebutton:webhooks:events userMaps: bigbluebutton:webhooks:userMaps - userMapPrefix: bigbluebutton:webhooks:userMap \ No newline at end of file + userMapPrefix: bigbluebutton:webhooks:userMap