MCPcopy Index your code
hub / github.com/code100x/cms / set

Method set

src/lib/cache/in-memory-cache.ts:23–34  ·  view source on GitHub ↗
(
    type: string,
    args: string[],
    value: any,
    expirySeconds: number = parseInt(process.env.CACHE_EXPIRE_S || '100', 10),
  )

Source from the content-addressed store, hash-verified

21 }
22
23 async set(
24 type: string,
25 args: string[],
26 value: any,
27 expirySeconds: number = parseInt(process.env.CACHE_EXPIRE_S || '100', 10),
28 ): Promise<void> {
29 const key = this.generateKey(type, args);
30 this.inMemoryDb.set(key, {
31 value,
32 expiry: new Date().getTime() + expirySeconds * 1000,
33 });
34 }
35
36 async get(type: string, args: string[]): Promise<any> {
37 const key = this.generateKey(type, args);

Callers

nothing calls this directly

Calls 2

generateKeyMethod · 0.95
setMethod · 0.65

Tested by

no test coverage detected