Skip to content

Commit 6740e00

Browse files
committed
correct warn flow for refreshConcurrency
1 parent a52032c commit 6740e00

File tree

1 file changed

+9
-5
lines changed
  • packages/cubejs-backend-shared/src

1 file changed

+9
-5
lines changed

packages/cubejs-backend-shared/src/env.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,17 @@ const variables: Record<string, (...args: any) => any> = {
177177
return refreshQueries;
178178
}
179179

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();
180+
const refreshConcurrency = get('CUBEJS_SCHEDULED_REFRESH_CONCURRENCY').asIntPositive();
181+
182+
if (refreshConcurrency) {
183+
console.warn(
184+
'The CUBEJS_SCHEDULED_REFRESH_CONCURRENCY is deprecated. Please, use the CUBEJS_SCHEDULED_REFRESH_QUERIES_PER_APP_ID instead.'
185+
);
186+
}
187+
188+
return refreshConcurrency;
184189
},
185190
refreshWorkerConcurrency: () => get('CUBEJS_REFRESH_WORKER_CONCURRENCY')
186-
.default(5)
187191
.asIntPositive(),
188192
// eslint-disable-next-line consistent-return
189193
scheduledRefreshTimezones: () => {

0 commit comments

Comments
 (0)