MCPcopy
hub / github.com/chartbrew/chartbrew / setCacheEntry

Method setCacheEntry

server/modules/runtimeCache.js:504–522  ·  view source on GitHub ↗
({ cacheKey, payload, ttlMs, staleTtlMs, registryKey })

Source from the content-addressed store, hash-verified

502 }
503
504 async setCacheEntry({ cacheKey, payload, ttlMs, staleTtlMs, registryKey }) {
505 const createdAt = Date.now();
506 const cacheEnvelope = {
507 payload,
508 createdAt,
509 freshUntil: createdAt + ttlMs,
510 staleUntil: createdAt + staleTtlMs,
511 };
512
513 await this.store.set(cacheKey, JSON.stringify(cacheEnvelope), staleTtlMs);
514 await this.store.hset(registryKey, cacheKey, `${cacheEnvelope.staleUntil}`);
515 this.debugLog("cache_write", {
516 cacheKey,
517 registryKey,
518 ttlMs,
519 staleTtlMs,
520 });
521 return cacheEnvelope;
522 }
523
524 async trackChartVariantUsage({ chartId, variantHash, runtimePayload, weight = 1 }) {
525 if (!chartId || !variantHash || !runtimePayload?.hasRuntimeFilters) {

Callers 2

setChartCacheMethod · 0.95
setSourceCacheMethod · 0.95

Calls 3

debugLogMethod · 0.95
hsetMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected