MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / triggerPull

Function triggerPull

src/stores/apiServer.ts:465–486  ·  view source on GitHub ↗
(sourceId: string, sessionId?: string)

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 7

startProgressPollingFunction · 0.85
fetchDataSourcesFunction · 0.85
generateIndexForSourceFunction · 0.85
triggerPullMethod · 0.65
errorMethod · 0.65
deleteMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected