MCPcopy Create free account
hub / github.com/clintonwoo/hackernews-react-graphql / warmCache

Function warmCache

server/database/cache-warmer.ts:13–19  ·  view source on GitHub ↗
(db: HnDatabase, cache: HnCache, feedService: FeedService)

Source from the content-addressed store, hash-verified

11const FIFTEEN_MINUTES = 1000 * 60 * 15;
12
13export function warmCache(db: HnDatabase, cache: HnCache, feedService: FeedService): void {
14 // Fetch the front pages
15 feedService.getForType(FeedType.TOP, 30, 0);
16 feedService.getForType(FeedType.NEW, 30, 0);
17
18 setTimeout(() => warmCache(db, cache, feedService), FIFTEEN_MINUTES);
19}
20
21function rebuildFeed(db: HnDatabase, cache: HnCache, feedType: FeedType): void {
22 setTimeout(() => rebuildFeed(db, cache, feedType), 1000 * 60 * 15, feedType);

Callers 1

server.tsFile · 0.90

Calls 1

getForTypeMethod · 0.80

Tested by

no test coverage detected