MCPcopy
hub / github.com/msgbyte/tianji / update

Function update

src/server/cache/index.ts:101–112  ·  view source on GitHub ↗
(...args: Args)

Source from the content-addressed store, hash-verified

99 };
100
101 const update = (...args: Args) => {
102 const key = buildKey(...args);
103
104 return async (value: T) => {
105 const cacheManager = await getCacheManager();
106 await cacheManager.set(key, JSON.stringify(value));
107
108 if (memTTL > 0) {
109 memCache.set(key, { value, expiry: Date.now() + memTTL });
110 }
111 };
112 };
113
114 const del = async (...args: Args) => {
115 const key = buildKey(...args);

Callers 1

useIntervalUpdateFunction · 0.85

Calls 3

buildKeyFunction · 0.85
getCacheManagerFunction · 0.85
nowMethod · 0.80

Tested by

no test coverage detected