Closed shanqs123 closed 9 months ago
use the timeout options.
timeout Number | Array - Request timeout in milliseconds for connecting phase and response receiving phase. Default is 5000. You can use timeout: 5000 to tell urllib use same timeout on two phase or set them seperately such as timeout: [3000, 5000], which will set connecting timeout to 3s and response 5s.
I find the missing connect options, I will send a pr to fix this problem.
When server is offline. GET operation will throw this error.
default undici connection timeout is set to 10e3. how could I config the time to 1500ms
ConnectTimeoutError: Connect Timeout Error at onConnectTimeout (D:\Codes\nodeJS\node_modules\undici\lib\core\connect.js:182:24) at D:\Codes\nodeJS\node_modules\undici\lib\core\connect.js:129:46 at Immediate._onImmediate (D:\Codes\nodeJS\node_modules\undici\lib\core\connect.js:168:33) at process.processImmediate (node:internal/timers:476:21) { code: 'UND_ERR_CONNECT_TIMEOUT',