Skip to content

Commit

Permalink
fix: allow renewQuery in dev mode with warning (#868) Thanks to @jcw-!
Browse files Browse the repository at this point in the history
* fix: allow renewQuery in dev mode with warning

* Empty commit to trigger a CI rerun

* Fix specs
  • Loading branch information
jcw- authored Jul 28, 2020
1 parent 0778afd commit dbdbb5f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/cubejs-playground/src/components/CachePane.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const CachePane = ({ query, cubejsApi }) => (
title: 'Refresh Key Value',
key: 'value',
render: (text, record) => rs && rs.loadResponse.usedPreAggregations
&& rs.loadResponse.usedPreAggregations[record.tableName].refreshKeyValues
&& rs.loadResponse.usedPreAggregations[record.tableName].refreshKeyValues.map(k => (
<PrismCode
key={JSON.stringify(k)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,16 @@ class PreAggregationLoader {
this.structureVersionPersistTime = preAggregations.structureVersionPersistTime;
this.externalRefresh = options.externalRefresh;
if (this.externalRefresh && this.waitForRenew) {
throw new Error("Invalid configuration - when externalRefresh is true, it will not perform a renew, therefore you cannot wait for it using waitForRenew.");
const message = 'Invalid configuration - when externalRefresh is true, it will not perform a renew, therefore you cannot wait for it using waitForRenew.';
if (['production', 'test'].includes(process.env.NODE_ENV)) {
throw new Error(message);
} else {
this.logger('Invalid Configuration', {
requestId: this.requestId,
warning: message,
});
this.waitForRenew = false;
}
}
}

Expand Down

0 comments on commit dbdbb5f

Please sign in to comment.