Skip to content

Commit 3400d80

Browse files
committed
Emit event on batch flushes
1 parent fdaae62 commit 3400d80

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

apps/webapp/app/services/runsReplicationService.server.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ type TaskRunInsert = { _version: bigint; run: TaskRun; event: "insert" | "update
6363

6464
export type RunsReplicationServiceEvents = {
6565
message: [{ lsn: string; message: PgoutputMessage; service: RunsReplicationService }];
66+
batchFlushed: [
67+
{ flushId: string; taskRunInserts: TaskRunV2[]; payloadInserts: RawTaskRunPayloadV1[] }
68+
];
6669
};
6770

6871
export class RunsReplicationService {
@@ -561,6 +564,8 @@ export class RunsReplicationService {
561564
taskRunInserts: taskRunInserts.length,
562565
payloadInserts: payloadInserts.length,
563566
});
567+
568+
this.events.emit("batchFlushed", { flushId, taskRunInserts, payloadInserts });
564569
});
565570
}
566571

0 commit comments

Comments
 (0)