Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions frontend/src/pages/DataSources.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,12 @@ export default function DataSourcesPage() {
}
}

const testSource = async (id: number) => {
const testSource = async (id: number, provider: string) => {
setTesting(id)
try {
const result = await fetchAPI<TestResult>(`/datasources/${id}/test`, { method: 'POST' })
// 雪球 Playwright 冷启动较慢,使用更长超时
const timeoutMs = provider === 'xueqiu' ? 90000 : 30000
const result = await fetchAPI<TestResult>(`/datasources/${id}/test`, { method: 'POST', timeoutMs })
setTestResult(result)
setTestResultOpen(true)
} catch (e) {
Expand Down Expand Up @@ -229,7 +231,7 @@ export default function DataSourcesPage() {
variant="ghost"
size="icon"
className="h-7 w-7"
onClick={() => testSource(source.id)}
onClick={() => testSource(source.id, source.provider)}
disabled={testing === source.id || !source.enabled}
title="测试连接"
>
Expand Down
Loading