From efedfda9c629078bf189d0f658432ef1eb2163b0 Mon Sep 17 00:00:00 2001 From: HDTianRu <3291691454@qq.com> Date: Sun, 18 Aug 2024 16:59:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=B9=85=E6=8F=90=E5=8D=87=E8=B6=85?= =?UTF-8?q?=E6=97=B6=E6=97=B6=E9=97=B4=EF=BC=88=E8=BF=99=E4=B8=8B=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E5=A4=9F=E4=BA=86=E5=90=A7=EF=BC=9F=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/network.js | 2 +- utils/request.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/network.js b/utils/network.js index a45c778..ffb1d37 100644 --- a/utils/network.js +++ b/utils/network.js @@ -1,6 +1,6 @@ import fetch from 'node-fetch'; -export async function checkLatency(url, timeout = 5000) { +export async function checkLatency(url, timeout = 10000) { const controller = new AbortController() const { signal } = controller const timeoutId = setTimeout(() => controller.abort(), timeout) diff --git a/utils/request.js b/utils/request.js index 4e99a5f..239a28d 100644 --- a/utils/request.js +++ b/utils/request.js @@ -23,7 +23,7 @@ const _request = async (url, options) => { * @param {number} retry 重试次数 * @returns {Promise} */ -const request = (url, options, retry = 0, timeout = 5000) => { +const request = (url, options, retry = 0, timeout = 30000) => { let err; const controller = new AbortController() const { signal } = controller