(sourceId: string, sessionId?: string)
| 463 | // ==================== 同步 ==================== |
| 464 | |
| 465 | async function triggerPull(sourceId: string, sessionId?: string) { |
| 466 | const trackId = sessionId || sourceId |
| 467 | pullingIds.value.add(trackId) |
| 468 | pullingIds.value = new Set(pullingIds.value) |
| 469 | const progressTimer = startProgressPolling() |
| 470 | try { |
| 471 | const result = await transport.triggerPull(sourceId, sessionId) |
| 472 | await fetchDataSources() |
| 473 | await useSessionStore().loadSessions() |
| 474 | generateIndexForSource(sourceId, sessionId) |
| 475 | return result |
| 476 | } catch (err) { |
| 477 | console.error('[ApiServerStore] Failed to trigger pull:', err) |
| 478 | return { success: false, error: String(err) } |
| 479 | } finally { |
| 480 | clearInterval(progressTimer) |
| 481 | pullingIds.value.delete(trackId) |
| 482 | pullingIds.value = new Set(pullingIds.value) |
| 483 | syncProgress.value.delete(trackId) |
| 484 | syncProgress.value = new Map(syncProgress.value) |
| 485 | } |
| 486 | } |
| 487 | |
| 488 | async function triggerPullAll(sourceId: string) { |
| 489 | const ds = dataSources.value.find((s) => s.id === sourceId) |
nothing calls this directly
no test coverage detected