Skip to content

Commit 9877037

Browse files
committed
feat: More places to fetch readOnly pre-aggregations flag from
1 parent 036f68a commit 9877037

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/cubejs-query-orchestrator/orchestrator/PreAggregations.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,11 +374,14 @@ class PreAggregationLoader {
374374
return (client) => {
375375
let refreshStrategy = this.refreshImplStoreInSourceStrategy;
376376
if (this.preAggregation.external) {
377-
refreshStrategy = client.readOnly && client.readOnly() ?
377+
const readOnly =
378+
client.config && client.config.readOnly ||
379+
client.readOnly && (typeof client.readOnly === 'boolean' ? client.readOnly : client.readOnly());
380+
refreshStrategy = readOnly ?
378381
this.refreshImplStreamExternalStrategy : this.refreshImplTempTableExternalStrategy;
379382
}
380383
const resultPromise = refreshStrategy.bind(this)(client, newVersionEntry);
381-
resultPromise.cancel = () => {} // TODO implement cancel (loading rollup into table and external upload)
384+
resultPromise.cancel = () => {}; // TODO implement cancel (loading rollup into table and external upload)
382385
return resultPromise;
383386
};
384387
}

0 commit comments

Comments
 (0)