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

Function readDispatch

apps/sim/lib/table/dispatcher.ts:337–359  ·  view source on GitHub ↗
(dispatchId: string)

Source from the content-addressed store, hash-verified

335}
336
337export async function readDispatch(dispatchId: string): Promise<DispatchRow | null> {
338 const [row] = await db
339 .select()
340 .from(tableRunDispatches)
341 .where(eq(tableRunDispatches.id, dispatchId))
342 .limit(1)
343 if (!row) return null
344 return {
345 id: row.id,
346 tableId: row.tableId,
347 workspaceId: row.workspaceId,
348 requestId: row.requestId,
349 mode: row.mode as DispatchMode,
350 scope: row.scope as DispatchScope,
351 status: row.status as DispatchStatus,
352 cursor: row.cursor,
353 limit: (row.limit as DispatchLimit | null) ?? null,
354 processedCount: row.processedCount,
355 isManualRun: row.isManualRun,
356 triggeredByUserId: row.triggeredByUserId,
357 requestedAt: row.requestedAt,
358 }
359}
360
361/** Drive `dispatcherStep` to completion. Shared between the trigger.dev task
362 * wrapper (`tableRunDispatcherTask`) and the in-process inline path so both

Callers 1

dispatcherStepFunction · 0.85

Calls 1

eqFunction · 0.50

Tested by

no test coverage detected