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 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
};
}

View File

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

View File

@ -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: