chore(extractor): make lazyUrlResultCache non-blocking and add stats

This commit is contained in:
WebStreamr 2026-01-14 11:58:42 +00:00
parent a189cddd37
commit 9d6d138fff
No known key found for this signature in database

View file

@ -24,14 +24,17 @@ export class ExtractorRegistry {
stats: true,
});
this.lazyUrlResultCache = new Cacheable({
nonBlocking: true,
primary: new Keyv({ store: new CacheableMemory({ lruSize: 1024 }) }),
secondary: new Keyv(new KeyvSqlite(`sqlite://${getCacheDir()}/webstreamr-extractor-lazy-cache.sqlite`)),
stats: true,
});
}
public stats() {
return {
urlResultCache: this.urlResultCache.stats,
lazyUrlResultCache: this.lazyUrlResultCache.stats,
};
};