mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 21:27:47 +00:00
commit
2841131dd0
2 changed files with 2 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
import fetch from 'node-fetch';
|
import fetch from 'node-fetch';
|
||||||
|
|
||||||
export async function checkLatency(url, timeout = 5000) {
|
export async function checkLatency(url, timeout = 10000) {
|
||||||
const controller = new AbortController()
|
const controller = new AbortController()
|
||||||
const { signal } = controller
|
const { signal } = controller
|
||||||
const timeoutId = setTimeout(() => controller.abort(), timeout)
|
const timeoutId = setTimeout(() => controller.abort(), timeout)
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ const _request = async (url, options) => {
|
||||||
* @param {number} retry 重试次数
|
* @param {number} retry 重试次数
|
||||||
* @returns {Promise<Response>}
|
* @returns {Promise<Response>}
|
||||||
*/
|
*/
|
||||||
const request = (url, options, retry = 0, timeout = 5000) => {
|
const request = (url, options, retry = 0, timeout = 30000) => {
|
||||||
let err;
|
let err;
|
||||||
const controller = new AbortController()
|
const controller = new AbortController()
|
||||||
const { signal } = controller
|
const { signal } = controller
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue