MCPcopy Create free account
hub / github.com/loopbackio/loopback-next / sweep

Method sweep

examples/greeting-app/src/caching-service.ts:103–111  ·  view source on GitHub ↗

* Remove expired items from the cache

()

Source from the content-addressed store, hash-verified

101 * Remove expired items from the cache
102 */
103 async sweep() {
104 debug('Sweeping cache...');
105 for (const key of this.store.keys()) {
106 if (await this.isExpired(key)) {
107 debug('Cache for %s is swept.', key);
108 await this.delete(key);
109 }
110 }
111 }
112
113 /**
114 * This method will be invoked when the application starts

Callers 1

startMethod · 0.95

Calls 3

isExpiredMethod · 0.95
deleteMethod · 0.95
keysMethod · 0.65

Tested by

no test coverage detected