File tree Expand file tree Collapse file tree
apps/webapp/app/services/clickhouse Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,6 +97,8 @@ function initializeLogsClickhouseClient() {
9797 } ) ;
9898}
9999
100+ const ADMIN_CLICKHOUSE_REQUEST_TIMEOUT_MS = 30_000 ;
101+
100102const defaultAdminClickhouseClient = singleton (
101103 "adminClickhouseClient" ,
102104 initializeAdminClickhouseClient
@@ -109,6 +111,7 @@ function initializeAdminClickhouseClient() {
109111
110112 const url = new URL ( env . ADMIN_CLICKHOUSE_URL ) ;
111113 url . searchParams . delete ( "secure" ) ;
114+ url . searchParams . delete ( "readonly" ) ;
112115
113116 return new ClickHouse ( {
114117 url : url . toString ( ) ,
@@ -120,6 +123,10 @@ function initializeAdminClickhouseClient() {
120123 logLevel : env . CLICKHOUSE_LOG_LEVEL ,
121124 compression : { request : true } ,
122125 maxOpenConnections : env . CLICKHOUSE_MAX_OPEN_CONNECTIONS ,
126+ // readonly=2 blocks writes while allowing bounded per-query settings.
127+ clickhouseSettings : { readonly : 2 } ,
128+ // Keep this above the missing-model query's 25-second execution limit.
129+ requestTimeoutMs : ADMIN_CLICKHOUSE_REQUEST_TIMEOUT_MS ,
123130 } ) ;
124131}
125132
You can’t perform that action at this time.
0 commit comments