chore: update default query timeout to 500ms (#447)

This commit is contained in:
Medcl
2025-04-26 11:29:39 +08:00
committed by GitHub
parent 6e07cacae2
commit f4a3838844
4 changed files with 5 additions and 5 deletions

View File

@@ -29,7 +29,7 @@ pub async fn query_coco_fusion<R: Runtime>(
let sources_list = sources_future.await;
// Time limit for each query
let timeout_duration = Duration::from_secs(query_timeout);
let timeout_duration = Duration::from_millis(query_timeout);
// Push all queries into futures
for query_source in sources_list {
@@ -52,7 +52,7 @@ pub async fn query_coco_fusion<R: Runtime>(
timeout(timeout_duration, async {
query_source_clone.search(query).await
})
.await
.await
}));
}

View File

@@ -187,7 +187,7 @@ const Advanced = () => {
value={queryTimeout}
className="w-20 h-8 px-2 rounded-md border bg-transparent border-black/5 dark:border-white/10"
onChange={(event) => {
setQueryTimeout(Number(event.target.value) || 5);
setQueryTimeout(Number(event.target.value) || 500);
}}
/>
</SettingsItem>

View File

@@ -160,7 +160,7 @@
},
"queryTimeout": {
"title": "Query Timeout",
"description": "Terminates the query if no search results are returned within this time. Default: 5s."
"description": "Terminates the query if no search results are returned within this time. Default: 500ms."
}
}
},

View File

@@ -160,7 +160,7 @@
},
"queryTimeout": {
"title": "查询超时",
"description": "在此时间内未返回搜索结果则终止查询。默认值5 秒。"
"description": "在此时间内未返回搜索结果则终止查询。默认值500 毫秒。"
}
}
},