diff --git a/price-service/package-lock.json b/price-service/package-lock.json index 85c366e3..455c971d 100644 --- a/price-service/package-lock.json +++ b/price-service/package-lock.json @@ -1,12 +1,12 @@ { "name": "@pythnetwork/pyth-price-service", - "version": "2.3.2", + "version": "2.3.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@pythnetwork/pyth-price-service", - "version": "2.3.2", + "version": "2.3.3", "license": "Apache-2.0", "dependencies": { "@certusone/wormhole-sdk": "^0.9.9", diff --git a/price-service/package.json b/price-service/package.json index e3d61ab3..31f1380d 100644 --- a/price-service/package.json +++ b/price-service/package.json @@ -1,6 +1,6 @@ { "name": "@pythnetwork/pyth-price-service", - "version": "2.3.2", + "version": "2.3.3", "description": "Pyth Price Service", "main": "index.js", "scripts": { diff --git a/price-service/src/listen.ts b/price-service/src/listen.ts index 3070b2ec..aca94166 100644 --- a/price-service/src/listen.ts +++ b/price-service/src/listen.ts @@ -114,8 +114,13 @@ export class VaaCache { async removeExpiredValues() { const now = Math.floor(Date.now() / 1000); - for (const arr of this.cache.values()) { - arr.filter((vaaConf) => now - vaaConf.publishTime < this.ttl); + for (const key of this.cache.keys()) { + this.cache.set( + key, + this.cache + .get(key)! + .filter((vaaConf) => now - vaaConf.publishTime < this.ttl) + ); } } }