Skip to content

Commit 126281c

Browse files
committed
First attempt to implement 'no-cache' scenario
1 parent a8a64fa commit 126281c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

packages/cubejs-query-orchestrator/src/orchestrator/QueryOrchestrator.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,25 @@ export class QueryOrchestrator {
210210
* @throw ContinueWaitError
211211
*/
212212
public async fetchQuery(queryBody: QueryBody): Promise<any> {
213+
if (queryBody.query && queryBody.cache === 'no-cache') {
214+
const result = await this.queryCache.cachedQueryResult(
215+
{ ...queryBody, forceNoCache: true },
216+
[]
217+
);
218+
219+
if (result instanceof QueryStream) {
220+
return result;
221+
}
222+
223+
return {
224+
...result,
225+
dataSource: queryBody.dataSource,
226+
external: queryBody.external,
227+
usedPreAggregations: {},
228+
lastRefreshTime: new Date(),
229+
};
230+
}
231+
213232
const {
214233
preAggregationsTablesToTempTables,
215234
values,

0 commit comments

Comments
 (0)