diff --git a/.changeset/large-feet-serve.md b/.changeset/large-feet-serve.md new file mode 100644 index 0000000000..a6bb64553e --- /dev/null +++ b/.changeset/large-feet-serve.md @@ -0,0 +1,5 @@ +--- +'@chainlink/tp-adapter': patch +--- + +Fix ICAP cache TTL refresh on heartbeat bug diff --git a/packages/sources/tp/src/transport/price.ts b/packages/sources/tp/src/transport/price.ts index e3baf5d4c9..64603711af 100644 --- a/packages/sources/tp/src/transport/price.ts +++ b/packages/sources/tp/src/transport/price.ts @@ -82,15 +82,12 @@ export const generateTransport = (generatePriceOptions: GeneratePriceOptions) => // Check for a heartbeat message, refresh the TTLs of all requested entries in the cache if (rec.includes('HBHHH')) { - const stream = rec.slice(22, 24) - if (stream === generatePriceOptions.streamName) { - logger.debug({ - msg: 'Received heartbeat message from WS, updating TTLs of active entries', - message, - }) - updateTTL(tpTransport, context.adapterSettings.CACHE_MAX_AGE) - return [] - } + logger.debug({ + msg: 'Received heartbeat message from WS, updating TTLs of active entries', + message, + }) + updateTTL(tpTransport, context.adapterSettings.CACHE_MAX_AGE) + return [] } const stream = rec.slice(31, 34)