[price-service] Hotfix cache (#508)
This commit is contained in:
parent
0812994745
commit
59b0efbf6c
|
@ -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",
|
||||
|
|
|
@ -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": {
|
||||
|
|
|
@ -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)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue