@@ -461,7 +461,7 @@ export class RefreshScheduler {
461461 } ) ) ;
462462 }
463463
464- protected async roundRobinRefreshPreAggregationsQueryIterator ( context , compilerApi : CompilerApi , queryingOptions ) {
464+ protected async roundRobinRefreshPreAggregationsQueryIterator ( context , compilerApi : CompilerApi , queryingOptions , queriesCache : { [ key : string ] : Promise < PreAggregationDescription [ ] [ ] > } ) {
465465 const { timezones, preAggregationsWarmup } = queryingOptions ;
466466 const scheduledPreAggregations = await compilerApi . scheduledPreAggregations ( ) ;
467467
@@ -470,7 +470,6 @@ export class RefreshScheduler {
470470 let partitionCursor = 0 ;
471471 let partitionCounter = 0 ;
472472
473- const queriesCache : { [ key : string ] : Promise < PreAggregationDescription [ ] [ ] > } = { } ;
474473 const finishedPartitions = { } ;
475474 scheduledPreAggregations . forEach ( ( p , pi ) => {
476475 timezones . forEach ( ( t , ti ) => {
@@ -579,13 +578,14 @@ export class RefreshScheduler {
579578 const { queryIteratorState, concurrency, workerIndices } = queryingOptions ;
580579
581580 const preAggregationsLoadCacheByDataSource = { } ;
581+ const queriesCache : { [ key : string ] : Promise < PreAggregationDescription [ ] [ ] > } = { } ;
582582 return Promise . all ( R . range ( 0 , concurrency )
583583 . filter ( workerIndex => workerIndices . indexOf ( workerIndex ) !== - 1 )
584584 . map ( async workerIndex => {
585585 const queryIteratorStateKey = JSON . stringify ( { ...securityContext , workerIndex } ) ;
586586 const queryIterator = queryIteratorState && queryIteratorState [ queryIteratorStateKey ] ||
587587 ( await this . roundRobinRefreshPreAggregationsQueryIterator (
588- context , compilerApi , queryingOptions
588+ context , compilerApi , queryingOptions , queriesCache
589589 ) ) ;
590590 if ( queryIteratorState ) {
591591 queryIteratorState [ queryIteratorStateKey ] = queryIterator ;
0 commit comments