File tree Expand file tree Collapse file tree 2 files changed +25
-5
lines changed
cubejs-backend-shared/src
cubejs-server-core/src/core Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,29 @@ const variables: Record<string, (...args: any) => any> = {
170170 // It's true by default for development
171171 return process . env . NODE_ENV !== 'production' ;
172172 } ,
173+ scheduledRefreshQueriesPerAppId : ( ) => {
174+ const refreshQueries = get ( 'CUBEJS_SCHEDULED_REFRESH_QUERIES_PER_APP_ID' ) . asIntPositive ( ) ;
175+
176+ if ( refreshQueries ) {
177+ return refreshQueries ;
178+ }
179+
180+ console . warn (
181+ 'The CUBEJS_SCHEDULED_REFRESH_CONCURRENCY is deprecated. Please, use the CUBEJS_SCHEDULED_REFRESH_QUERIES_PER_APP_ID instead.'
182+ ) ;
183+ return get ( 'CUBEJS_SCHEDULED_REFRESH_CONCURRENCY' ) . asIntPositive ( ) ;
184+ } ,
185+ refreshWorkerConcurrency : ( ) => get ( 'CUBEJS_REFRESH_WORKER_CONCURRENCY' )
186+ . default ( 5 )
187+ . asIntPositive ( ) ,
188+ // eslint-disable-next-line consistent-return
189+ scheduledRefreshTimezones : ( ) => {
190+ const timezones = get ( 'CUBEJS_SCHEDULED_REFRESH_TIMEZONES' ) . asString ( ) ;
191+
192+ if ( timezones ) {
193+ return timezones . split ( ',' ) . map ( t => t . trim ( ) ) ;
194+ }
195+ } ,
173196 preAggregationsBuilder : ( ) => get ( 'CUBEJS_PRE_AGGREGATIONS_BUILDER' ) . asBool ( ) ,
174197 gracefulShutdown : ( ) => get ( 'CUBEJS_GRACEFUL_SHUTDOWN' )
175198 . asIntPositive ( ) ,
Original file line number Diff line number Diff line change @@ -453,15 +453,12 @@ export class OptsHandler {
453453 externalDialectFactory,
454454 apiSecret : process . env . CUBEJS_API_SECRET ,
455455 telemetry : getEnv ( 'telemetry' ) ,
456- scheduledRefreshTimeZones :
457- process . env . CUBEJS_SCHEDULED_REFRESH_TIMEZONES &&
458- process . env . CUBEJS_SCHEDULED_REFRESH_TIMEZONES . split ( ',' ) . map ( t => t . trim ( ) ) ,
456+ scheduledRefreshTimeZones : getEnv ( 'scheduledRefreshTimezones' ) ,
459457 scheduledRefreshContexts : async ( ) => [ null ] ,
460458 basePath : '/cubejs-api' ,
461459 dashboardAppPath : 'dashboard-app' ,
462460 dashboardAppPort : 3000 ,
463- scheduledRefreshConcurrency :
464- parseInt ( process . env . CUBEJS_SCHEDULED_REFRESH_CONCURRENCY , 10 ) ,
461+ scheduledRefreshConcurrency : getEnv ( 'scheduledRefreshQueriesPerAppId' ) ,
465462 scheduledRefreshBatchSize : getEnv ( 'scheduledRefreshBatchSize' ) ,
466463 preAggregationsSchema :
467464 getEnv ( 'preAggregationsSchema' ) ||
You can’t perform that action at this time.
0 commit comments