Skip to content

Commit 5168714

Browse files
committed
fix(webapp): route recordEvent/traceEvent batched writes through insertMany
The postgres-writes-disabled guard was bypassed: recordEvent and traceEvent fed the flush scheduler directly for non-immediate events, so they still wrote to PostgreSQL with the flag on. Route both through the guarded insertMany, making it the only feeder of the flush scheduler.
1 parent c46563a commit 5168714

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

apps/webapp/app/v3/eventRepository/eventRepository.server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ export class EventRepository implements IEventRepository {
10271027
if (options.immediate) {
10281028
await this.insertImmediate(event);
10291029
} else {
1030-
this._flushScheduler.addToBatch([this.#createableEventToPrismaEvent(event)]);
1030+
this.insertMany([event]);
10311031
}
10321032
}
10331033

@@ -1161,7 +1161,7 @@ export class EventRepository implements IEventRepository {
11611161
if (options.immediate) {
11621162
await this.insertImmediate(event);
11631163
} else {
1164-
this._flushScheduler.addToBatch([this.#createableEventToPrismaEvent(event)]);
1164+
this.insertMany([event]);
11651165
}
11661166

11671167
return result;

0 commit comments

Comments
 (0)