MCPcopy Index your code
hub / github.com/simstudioai/sim / completeSyncLog

Function completeSyncLog

apps/sim/lib/knowledge/connectors/sync-engine.ts:197–216  ·  view source on GitHub ↗
(
  syncLogId: string,
  status: 'completed' | 'failed',
  result: SyncResult,
  errorMessage?: string
)

Source from the content-addressed store, hash-verified

195}
196
197async function completeSyncLog(
198 syncLogId: string,
199 status: 'completed' | 'failed',
200 result: SyncResult,
201 errorMessage?: string
202): Promise<void> {
203 await db
204 .update(knowledgeConnectorSyncLog)
205 .set({
206 status,
207 completedAt: new Date(),
208 ...(errorMessage != null && { errorMessage }),
209 docsAdded: result.docsAdded,
210 docsUpdated: result.docsUpdated,
211 docsDeleted: result.docsDeleted,
212 docsUnchanged: result.docsUnchanged,
213 docsFailed: result.docsFailed,
214 })
215 .where(eq(knowledgeConnectorSyncLog.id, syncLogId))
216}
217
218/**
219 * Decides whether deletion reconciliation may run for a sync.

Callers 1

executeSyncFunction · 0.85

Calls 2

setMethod · 0.65
eqFunction · 0.50

Tested by

no test coverage detected