Skip to content

Commit 6524a84

Browse files
authored
fix(server-core): config validation if custom ContextAcceptor is (#6120)
provided
1 parent 5187506 commit 6524a84

File tree

1 file changed

+5
-4
lines changed
  • packages/cubejs-server-core/src/core

1 file changed

+5
-4
lines changed

packages/cubejs-server-core/src/core/server.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -691,14 +691,15 @@ export class CubejsServerCore {
691691
* @internal Please dont use this method directly, use refreshTimer
692692
*/
693693
public handleScheduledRefreshInterval = async (options) => {
694-
const contexts = (await this.options.scheduledRefreshContexts()).filter(
695-
(context) => this.contextAcceptor.shouldAccept(this.migrateBackgroundContext(context)).accepted
696-
);
697-
if (contexts.length < 1) {
694+
const allContexts = await this.options.scheduledRefreshContexts();
695+
if (allContexts.length < 1) {
698696
this.logger('Refresh Scheduler Error', {
699697
error: 'At least one context should be returned by scheduledRefreshContexts'
700698
});
701699
}
700+
const contexts = allContexts.filter(
701+
(context) => this.contextAcceptor.shouldAccept(this.migrateBackgroundContext(context)).accepted
702+
);
702703

703704
const batchLimit = pLimit(this.options.scheduledRefreshBatchSize);
704705
return Promise.all(

0 commit comments

Comments
 (0)