Skip to content

Commit

Permalink
feat: 默认超时 8000ms
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Nov 24, 2024
1 parent d4c4197 commit 5144145
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.14.425",
"version": "2.14.426",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion backend/src/core/proxy-utils/processors/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ function ResolveDomainOperator({
throw new Error(`域名解析服务提供方 ${provider} 不支持 ${_type}`);
}
const { defaultTimeout } = $.read(SETTINGS_KEY);
const requestTimeout = timeout || defaultTimeout;
const requestTimeout = timeout || defaultTimeout || 8000;
let type = ['IPv6', 'IP4P'].includes(_type) ? 'IPv6' : 'IPv4';

const resolver = DOMAIN_RESOLVERS[provider];
Expand Down
2 changes: 1 addition & 1 deletion backend/src/utils/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default async function download(
proxy = proxy || eval('process.env.SUB_STORE_BACKEND_DEFAULT_PROXY');
}
const userAgent = ua || defaultUserAgent || 'clash.meta';
const requestTimeout = timeout || defaultTimeout;
const requestTimeout = timeout || defaultTimeout || 8000;
const id = hex_md5(userAgent + url);

if ($arguments?.cacheKey === true) {
Expand Down
2 changes: 1 addition & 1 deletion backend/src/utils/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export async function getFlowHeaders(
proxy = proxy || eval('process.env.SUB_STORE_BACKEND_DEFAULT_PROXY');
}
const userAgent = ua || defaultFlowUserAgent || 'clash';
const requestTimeout = timeout || defaultTimeout;
const requestTimeout = timeout || defaultTimeout || 8000;
const id = hex_md5(userAgent + url);
const cached = headersResourceCache.get(id);
let flowInfo;
Expand Down
4 changes: 2 additions & 2 deletions backend/src/utils/gist.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default class Gist {
...(isLoon && proxy ? { node: proxy } : {}),
...(isQX && proxy ? { opts: { policy: proxy } } : {}),
...(proxy ? getPolicyDescriptor(proxy) : {}),
timeout,
timeout: timeout || 8000,

events: {
onResponse: (resp) => {
Expand Down Expand Up @@ -81,7 +81,7 @@ export default class Gist {
...(isLoon && proxy ? { node: proxy } : {}),
...(isQX && proxy ? { opts: { policy: proxy } } : {}),
...(proxy ? getPolicyDescriptor(proxy) : {}),
timeout,
timeout: timeout || 8000,

events: {
onResponse: (resp) => {
Expand Down

0 comments on commit 5144145

Please sign in to comment.