11import type { ClickHouse } from "@internal/clickhouse" ;
2- import { TASK_RUN_COLUMNS , PAYLOAD_COLUMNS } from "@internal/clickhouse" ;
32import { type RedisOptions } from "@internal/redis" ;
43import {
54 LogicalReplicationClient ,
@@ -760,14 +759,14 @@ export class RunsReplicationService {
760759 #getClickhouseInsertSettings( ) {
761760 if ( this . _insertStrategy === "insert" ) {
762761 return { } ;
763- } else if ( this . _insertStrategy === "insert_async" ) {
764- return {
765- async_insert : 1 as const ,
766- async_insert_max_data_size : "1000000" ,
767- async_insert_busy_timeout_ms : 1000 ,
768- wait_for_async_insert : this . options . waitForAsyncInsert ? ( 1 as const ) : ( 0 as const ) ,
769- } ;
770762 }
763+
764+ return {
765+ async_insert : 1 as const ,
766+ async_insert_max_data_size : "1000000" ,
767+ async_insert_busy_timeout_ms : 1000 ,
768+ wait_for_async_insert : this . options . waitForAsyncInsert ? ( 1 as const ) : ( 0 as const ) ,
769+ } ;
771770 }
772771
773772 async #insertTaskRunInserts( taskRunInserts : any [ ] [ ] , attempt : number ) {
@@ -825,18 +824,8 @@ export class RunsReplicationService {
825824
826825 const { run, _version, event } = batchedRun ;
827826
828- if ( ! run . environmentType ) {
829- return {
830- taskRunInsert : undefined ,
831- payloadInsert : undefined ,
832- } ;
833- }
834-
835- if ( ! run . organizationId ) {
836- return {
837- taskRunInsert : undefined ,
838- payloadInsert : undefined ,
839- } ;
827+ if ( ! run . environmentType || ! run . organizationId ) {
828+ return { } ;
840829 }
841830
842831 if ( event === "update" || event === "delete" || this . _disablePayloadInsert ) {
@@ -848,21 +837,15 @@ export class RunsReplicationService {
848837 _version
849838 ) ;
850839
851- return {
852- taskRunInsert,
853- payloadInsert : undefined ,
854- } ;
840+ return { taskRunInsert } ;
855841 }
856842
857843 const [ taskRunInsert , payloadInsert ] = await Promise . all ( [
858844 this . #prepareTaskRunInsert( run , run . organizationId , run . environmentType , event , _version ) ,
859845 this . #preparePayloadInsert( run , _version ) ,
860846 ] ) ;
861847
862- return {
863- taskRunInsert,
864- payloadInsert,
865- } ;
848+ return { taskRunInsert, payloadInsert } ;
866849 }
867850
868851 async #prepareTaskRunInsert(
0 commit comments