feat: adjust timeout

This commit is contained in:
shinya
2025-08-21 00:01:03 +08:00
parent 05b604d398
commit 8c1a26a4e8
3 changed files with 5 additions and 5 deletions

View File

@@ -26,7 +26,7 @@ async function searchWithCache(
query: string,
page: number,
url: string,
timeoutMs = 5000
timeoutMs = 8000
): Promise<{ results: SearchResult[]; pageCount?: number }> {
// 先查缓存
const cached = getCachedSearchPage(apiSite.key, query, page);
@@ -145,7 +145,7 @@ export async function searchFromApi(
apiBaseUrl + API_CONFIG.search.path + encodeURIComponent(query);
// 使用新的缓存搜索函数处理第一页
const firstPageResult = await searchWithCache(apiSite, query, 1, apiUrl, 5000);
const firstPageResult = await searchWithCache(apiSite, query, 1, apiUrl, 8000);
const results = firstPageResult.results;
const pageCountFromFirst = firstPageResult.pageCount;
@@ -170,7 +170,7 @@ export async function searchFromApi(
const pagePromise = (async () => {
// 使用新的缓存搜索函数处理分页
const pageResult = await searchWithCache(apiSite, query, page, pageUrl, 5000);
const pageResult = await searchWithCache(apiSite, query, page, pageUrl, 8000);
return pageResult.results;
})();