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

Function listActiveDispatches

apps/sim/lib/table/dispatcher.ts:310–335  ·  view source on GitHub ↗
(tableId: string)

Source from the content-addressed store, hash-verified

308}
309
310export async function listActiveDispatches(tableId: string): Promise<DispatchRow[]> {
311 const rows = await db
312 .select()
313 .from(tableRunDispatches)
314 .where(
315 and(
316 eq(tableRunDispatches.tableId, tableId),
317 inArray(tableRunDispatches.status, [...ACTIVE_DISPATCH_STATUSES])
318 )
319 )
320 return rows.map((row) => ({
321 id: row.id,
322 tableId: row.tableId,
323 workspaceId: row.workspaceId,
324 requestId: row.requestId,
325 mode: row.mode as DispatchMode,
326 scope: row.scope as DispatchScope,
327 status: row.status as DispatchStatus,
328 cursor: row.cursor,
329 limit: (row.limit as DispatchLimit | null) ?? null,
330 processedCount: row.processedCount,
331 isManualRun: row.isManualRun,
332 triggeredByUserId: row.triggeredByUserId,
333 requestedAt: row.requestedAt,
334 }))
335}
336
337export async function readDispatch(dispatchId: string): Promise<DispatchRow | null> {
338 const [row] = await db

Callers 3

route.tsFile · 0.90
countActiveRunCellsFunction · 0.85
cancelWorkflowGroupRunsFunction · 0.85

Calls 1

eqFunction · 0.50

Tested by

no test coverage detected