Skip to content

Commit

Permalink
feat: Add refreshKeyRenewalThreshold option
Browse files Browse the repository at this point in the history
Fixes #112
  • Loading branch information
paveltiunov committed May 22, 2019
1 parent 4426e00 commit aa69449
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions packages/cubejs-query-orchestrator/orchestrator/QueryCache.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,13 @@ class QueryCache {
renewQuery(query, values, cacheKeyQueries, expireSecs, cacheKey, renewalThreshold, options) {
options = options || {};
return Promise.all(
cacheKeyQueries.map(q =>
this.cacheQueryResult(
Array.isArray(q) ? q[0] : q,
Array.isArray(q) ? q[1] : [],
q,
expireSecs,
{ renewalThreshold: 2 * 60, renewalKey: q, waitForRenew: true }
)
)
cacheKeyQueries.map(q => this.cacheQueryResult(
Array.isArray(q) ? q[0] : q,
Array.isArray(q) ? q[1] : [],
q,
expireSecs,
{ renewalThreshold: this.options.refreshKeyRenewalThreshold || 2 * 60, renewalKey: q, waitForRenew: true }
))
)
.catch(e => {
if (e instanceof ContinueWaitError) {
Expand Down

0 comments on commit aa69449

Please sign in to comment.