Skip to content

Commit d15c551

Browse files
committed
fix: Remove user facing errors for pre-aggregations refreshes
1 parent dceaf46 commit d15c551

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

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

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -286,14 +286,7 @@ class PreAggregationLoader {
286286
await this.executeInQueue(invalidationKeys, this.priority(0), newVersionEntry);
287287
return mostRecentTargetTableName();
288288
} else {
289-
if (
290-
this.preAggregations.refreshErrors[newVersionEntry.table_name] &&
291-
this.preAggregations.refreshErrors[newVersionEntry.table_name][newVersionEntry.content_version] &&
292-
this.preAggregations.refreshErrors[newVersionEntry.table_name][newVersionEntry.content_version].counter > 10) {
293-
throw this.preAggregations.refreshErrors[newVersionEntry.table_name][newVersionEntry.content_version].error;
294-
} else {
295-
this.scheduleRefresh(invalidationKeys, newVersionEntry);
296-
}
289+
this.scheduleRefresh(invalidationKeys, newVersionEntry);
297290
}
298291
}
299292
} else {
@@ -347,18 +340,8 @@ class PreAggregationLoader {
347340
requestId: this.requestId
348341
});
349342
this.executeInQueue(invalidationKeys, this.priority(0), newVersionEntry)
350-
.then(() => {
351-
delete this.preAggregations.refreshErrors[newVersionEntry.table_name];
352-
})
353343
.catch(e => {
354344
if (!(e instanceof ContinueWaitError)) {
355-
this.preAggregations.refreshErrors[newVersionEntry.table_name] = this.preAggregations.refreshErrors[newVersionEntry.table_name] || {};
356-
if (!this.preAggregations.refreshErrors[newVersionEntry.table_name][newVersionEntry.content_version]) {
357-
this.preAggregations.refreshErrors[newVersionEntry.table_name][newVersionEntry.content_version] = { error: e, counter: 1 };
358-
} else {
359-
this.preAggregations.refreshErrors[newVersionEntry.table_name][newVersionEntry.content_version].error = e;
360-
this.preAggregations.refreshErrors[newVersionEntry.table_name][newVersionEntry.content_version].counter += 1;
361-
}
362345
this.logger('Error refreshing pre-aggregation', {
363346
error: (e.stack || e), preAggregation: this.preAggregation, requestId: this.requestId
364347
});
@@ -541,7 +524,6 @@ class PreAggregations {
541524
this.driverFactory = clientFactory;
542525
this.logger = logger;
543526
this.queryCache = queryCache;
544-
this.refreshErrors = {}; // TODO should be in redis
545527
this.cacheDriver = options.cacheAndQueueDriver === 'redis' ?
546528
new RedisCacheDriver(options.redisPool) :
547529
new LocalCacheDriver();

0 commit comments

Comments
 (0)