Merge pull request #9924 from prlanzarin/upstream-2.2-webhooks-timeout

bbb-webhooks: add a timeout configuration to be used on POST requests
This commit is contained in:
Fred Dixon 2020-07-05 16:01:19 -04:00 committed by GitHub
commit a6eda3da91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 4 deletions

View File

@ -65,6 +65,7 @@ module.exports = class CallbackEmitter extends EventEmitter {
const serverDomain = config.get("bbb.serverDomain"); const serverDomain = config.get("bbb.serverDomain");
const sharedSecret = config.get("bbb.sharedSecret"); const sharedSecret = config.get("bbb.sharedSecret");
const bearerAuth = config.get("bbb.auth2_0"); const bearerAuth = config.get("bbb.auth2_0");
const timeout = config.get('hooks.requestTimeout');
// data to be sent // data to be sent
// note: keep keys in alphabetical order // note: keep keys in alphabetical order
@ -85,7 +86,8 @@ module.exports = class CallbackEmitter extends EventEmitter {
form: data, form: data,
auth: { auth: {
bearer: sharedSecret bearer: sharedSecret
} },
timeout
}; };
} }
else { else {
@ -103,7 +105,8 @@ module.exports = class CallbackEmitter extends EventEmitter {
maxRedirects: 10, maxRedirects: 10,
uri: callbackURL, uri: callbackURL,
method: "POST", method: "POST",
form: data form: data,
timeout
}; };
} }

View File

@ -6,6 +6,9 @@ hooks:
permanentURLs: permanentURLs:
__name: PERMANENT_HOOKS __name: PERMANENT_HOOKS
__format: json __format: json
requestTimeout:
__name: REQUEST_TIMEOUT
__format: json
redis: redis:
host: REDIS_HOST host: REDIS_HOST
port: REDIS_PORT port: REDIS_PORT

View File

@ -47,6 +47,8 @@ hooks:
- 60000 - 60000
# Reset permanent interval when exceeding maximum attemps # Reset permanent interval when exceeding maximum attemps
permanentIntervalReset: 8 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 of internal to external meeting IDs
mappings: mappings: