@chainlink/external-adapter-framework 0.0.32 → 0.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -60,20 +60,27 @@ class BatchWarmingTransport {
|
|
|
60
60
|
}
|
|
61
61
|
async setup(req, config) {
|
|
62
62
|
logger.debug(`Adding entry to batch warming set: [${req.requestContext.cacheKey}] = ${req.requestContext.data}`);
|
|
63
|
-
|
|
63
|
+
logger.debug('about to add to subscription set');
|
|
64
|
+
const res = await this.subscriptionSet.add(req.requestContext.cacheKey, req.requestContext.data, config.WARMUP_SUBSCRIPTION_TTL);
|
|
65
|
+
logger.debug('done adding to subscription set');
|
|
66
|
+
logger.debug('Adding subscription set res', res);
|
|
67
|
+
logger.debug('Get request', await this.subscriptionSet.get(req.requestContext.cacheKey));
|
|
64
68
|
}
|
|
65
69
|
async backgroundExecute(context) {
|
|
66
70
|
logger.debug('Starting background execute');
|
|
67
71
|
const entries = await this.subscriptionSet.getAll();
|
|
68
72
|
logger.debug(`entries: ${JSON.stringify(entries)}`);
|
|
69
73
|
logger.debug(entries.length);
|
|
74
|
+
logger.debug(!entries.length);
|
|
70
75
|
if (!entries.length) {
|
|
71
76
|
logger.debug('No entries in batch warming set, skipping');
|
|
72
77
|
if (this.WARMER_ACTIVE) {
|
|
78
|
+
logger.debug(this.WARMER_ACTIVE);
|
|
73
79
|
// Decrement count when warmer changed from having entries to having none
|
|
74
80
|
cacheMetrics.cacheWarmerCount.labels({ isBatched: 'true' }).dec();
|
|
75
81
|
this.WARMER_ACTIVE = false;
|
|
76
82
|
}
|
|
83
|
+
logger.debug(this.WARMER_ACTIVE);
|
|
77
84
|
return this.rateLimiter.msUntilNextExecution(context.adapterEndpoint.name);
|
|
78
85
|
}
|
|
79
86
|
else if (this.WARMER_ACTIVE === false) {
|