Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.

Commit de7b689

Browse files
committed
perf(validator): Only keep a small message validator cache.
1 parent 1e4892c commit de7b689

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/subscribe/Validator.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ export default function Validator(client, opts) {
4141
},
4242
verify: CacheAsyncFn(SigningUtil.verify.bind(SigningUtil), {
4343
...client.options.cache,
44-
cachePromiseRejection: false,
44+
// forcibly use small cache otherwise keeps n serialized messages in memory
45+
maxSize: 100,
46+
maxAge: 10000,
47+
cachePromiseRejection: true,
4548
cacheKey: (args) => args.join('|'),
4649
})
4750
})

0 commit comments

Comments
 (0)