File tree Expand file tree Collapse file tree 4 files changed +12
-0
lines changed Expand file tree Collapse file tree 4 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,12 @@ export const env = createEnv({
21
21
. refine ( ( arr ) => arr . length > 0 , {
22
22
message : "KAFKA_BROKERS must be a non-empty list of brokers" ,
23
23
} ) ,
24
+
25
+ KAFKA_PARTITIONS_CONSUMED_CONCURRENTLY : z
26
+ . number ( )
27
+ . default ( 5 )
28
+ . transform ( ( val ) => parseInt ( val . toString ( ) ) ) ,
29
+
24
30
GITHUB_BOT_APP_ID : z . string ( ) . optional ( ) ,
25
31
GITHUB_BOT_PRIVATE_KEY : z . string ( ) . optional ( ) ,
26
32
GITHUB_BOT_CLIENT_ID : z . string ( ) . optional ( ) ,
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export const start = async () => {
22
22
logger . info ( "Subscribed to ctrlplane-events topic" ) ;
23
23
24
24
await consumer . run ( {
25
+ partitionsConsumedConcurrently : env . KAFKA_PARTITIONS_CONSUMED_CONCURRENTLY ,
25
26
eachMessage : async ( { topic, partition, message } ) => {
26
27
logger . info ( "Received event" , {
27
28
topic,
Original file line number Diff line number Diff line change @@ -8,8 +8,11 @@ const { Pool } = pg;
8
8
9
9
export const pool = new Pool ( {
10
10
max : env . POSTGRES_MAX_POOL_SIZE ,
11
+ min : 1 ,
11
12
connectionString : env . POSTGRES_URL ,
13
+ keepAlive : true ,
12
14
ssl : false ,
15
+ application_name : env . POSTGRES_APPLICATION_NAME ,
13
16
} ) ;
14
17
15
18
export const db = drizzle ( pool , { schema } ) ;
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ export const env = createEnv({
13
13
. default ( "50" )
14
14
. transform ( ( value ) => parseInt ( value ) ) ,
15
15
16
+ POSTGRES_APPLICATION_NAME : z . string ( ) . default ( "ctrlplane" ) ,
17
+
16
18
REDIS_URL : z . string ( ) . url ( ) . default ( "redis://127.0.0.1:6379" ) ,
17
19
} ,
18
20
runtimeEnv : process . env ,
You can’t perform that action at this time.
0 commit comments