File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { singleton } from "~/utils/singleton";
66import { organizationDataStoresRegistry } from "~/services/dataStores/organizationDataStoresRegistryInstance.server" ;
77import type { OrganizationDataStoresRegistry } from "~/services/dataStores/organizationDataStoresRegistry.server" ;
88import { type IEventRepository } from "~/v3/eventRepository/eventRepository.types" ;
9+ import { eventRepository as postgresEventRepository } from "~/v3/eventRepository/eventRepository.server" ;
910
1011// ---------------------------------------------------------------------------
1112// Default clients (singleton per process)
@@ -254,6 +255,14 @@ export class ClickhouseFactory {
254255 store : string ,
255256 organizationId : string
256257 ) : { key : string ; repository : IEventRepository } {
258+ // Non-ClickHouse stores (e.g. the "taskEvent" DB default for Postgres-backed
259+ // runs, or "postgres") fall back to the Prisma event repository. This lets
260+ // callers pass `run.taskEventStore` directly without needing to guard
261+ // against legacy/Postgres values.
262+ if ( store !== "clickhouse" && store !== "clickhouse_v2" ) {
263+ return { key : `postgres:${ store } ` , repository : postgresEventRepository } ;
264+ }
265+
257266 const dataStore = this . _registry . get ( organizationId , "CLICKHOUSE" ) ;
258267
259268 if ( ! dataStore ) {
Original file line number Diff line number Diff line change @@ -79,8 +79,12 @@ export async function getEventRepository(
7979) : Promise < { repository : IEventRepository ; store : string } > {
8080 const taskEventStore = parentStore ?? ( await resolveTaskEventRepositoryFlag ( featureFlags ) ) ;
8181
82- // Support legacy Postgres store for self-hosters
83- if ( taskEventStore === EVENT_STORE_TYPES . POSTGRES ) {
82+ // Non-ClickHouse stores (e.g. the "taskEvent" DB default for Postgres-backed
83+ // runs, or the legacy "postgres" value) resolve to the Prisma event repo.
84+ if (
85+ taskEventStore !== EVENT_STORE_TYPES . CLICKHOUSE &&
86+ taskEventStore !== EVENT_STORE_TYPES . CLICKHOUSE_V2
87+ ) {
8488 return { repository : eventRepository , store : getTaskEventStore ( ) } ;
8589 }
8690
You can’t perform that action at this time.
0 commit comments