feat: got request timeout

This commit is contained in:
DIYgod
2021-02-01 20:06:49 +08:00
parent 177c36cae7
commit 89e82d88fa
4 changed files with 25 additions and 0 deletions

View File

@@ -39,6 +39,7 @@ const calculateValue = () => {
ua: envs.UA || 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36',
listenInaddrAny: envs.LISTEN_INADDR_ANY || 1, // 是否允许公网连接,取值 0 1
requestRetry: parseInt(envs.REQUEST_RETRY) || 2, // 请求失败重试次数
requestTimeout: parseInt(envs.REQUEST_TIMEOUT) || 30000, // Milliseconds to wait for the server to end the response before aborting the request
// 是否显示 Debug 信息,取值 'true' 'false' 'some_string' ,取值为 'true' 时永久显示,取值为 'false' 时永远隐藏,取值为 'some_string' 时请求带上 '?debug=some_string' 显示
debugInfo: envs.DEBUG_INFO || 'true',
disallowRobot: envs.DISALLOW_ROBOT !== '0' && envs.DISALLOW_ROBOT !== 'false',