Skip to content

Commit dbf44d5

Browse files
committed
fix(tables): add hasRunningGroupExecution and import it
1 parent c3bd25e commit dbf44d5

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

apps/sim/hooks/queries/tables.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ import type {
7070
WorkflowGroupDependencies,
7171
WorkflowGroupOutput,
7272
} from '@/lib/table'
73-
import { areOutputsFilled, optimisticallyScheduleNewlyEligibleGroups } from '@/lib/table/deps'
73+
import {
74+
areOutputsFilled,
75+
hasRunningGroupExecution,
76+
optimisticallyScheduleNewlyEligibleGroups,
77+
} from '@/lib/table/deps'
7478

7579
const logger = createLogger('TableQueries')
7680

apps/sim/lib/table/deps.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ export function isExecInFlight(exec: RowExecutionMetadata | undefined): boolean
2424
return false
2525
}
2626

27+
export function hasRunningGroupExecution(rows: TableRow[]): boolean {
28+
for (const row of rows) {
29+
for (const exec of Object.values(row.executions)) {
30+
if (isExecInFlight(exec)) return true
31+
}
32+
}
33+
return false
34+
}
35+
2736
/**
2837
* True when every output column the group writes still has a non-empty value
2938
* on this row. The "completed" exec status is metadata, but the cells are the

0 commit comments

Comments
 (0)