mirror of
https://github.com/infinilabs/coco-app.git
synced 2025-12-16 11:37:47 +01:00
chore: update default query timeout to 500ms (#447)
This commit is contained in:
@@ -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
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
},
|
||||
"queryTimeout": {
|
||||
"title": "查询超时",
|
||||
"description": "在此时间内未返回搜索结果,则终止查询。默认值:5 秒。"
|
||||
"description": "在此时间内未返回搜索结果,则终止查询。默认值:500 毫秒。"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user