大幅提升超时时间(这下应该够了吧?)

This commit is contained in:
HDTianRu 2024-08-18 16:59:32 +08:00
parent cf07849130
commit efedfda9c6
2 changed files with 2 additions and 2 deletions

View file

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

View file

@ -23,7 +23,7 @@ const _request = async (url, options) => {
* @param {number} retry 重试次数
* @returns {Promise<Response>}
*/
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