|
|
|
@ -3,6 +3,18 @@ import { PassThrough } from 'stream'; |
|
|
|
|
|
|
|
|
|
import { EmailTest } from 'meteor/email'; |
|
|
|
|
import { Mongo } from 'meteor/mongo'; |
|
|
|
|
import { HTTP } from 'meteor/http'; |
|
|
|
|
|
|
|
|
|
// Set default HTTP call timeout to 20s
|
|
|
|
|
const envTimeout = parseInt(process.env.HTTP_DEFAULT_TIMEOUT, 10); |
|
|
|
|
const timeout = !isNaN(envTimeout) ? envTimeout : 20000; |
|
|
|
|
|
|
|
|
|
const { call } = HTTP; |
|
|
|
|
HTTP.call = function _call(method, url, options = {}, callback) { |
|
|
|
|
const defaultTimeout = 'timeout' in options ? options : { ...options, timeout }; |
|
|
|
|
|
|
|
|
|
return call.call(HTTP, method, url, defaultTimeout, callback); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// FIX For TLS error see more here https://github.com/RocketChat/Rocket.Chat/issues/9316
|
|
|
|
|
// TODO: Remove after NodeJS fix it, more information
|
|
|
|
|