MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / setToCacheBinary

Function setToCacheBinary

apps/api/src/controllers/misc.controller.ts:57–67  ·  view source on GitHub ↗
(
  key: string,
  buffer: Buffer,
  contentType: string,
)

Source from the content-addressed store, hash-verified

55}
56
57async function setToCacheBinary(
58 key: string,
59 buffer: Buffer,
60 contentType: string,
61): Promise<void> {
62 const redis = getRedisCache();
63 await Promise.all([
64 redis.set(key, buffer.toString('base64'), 'EX', TTL_SECONDS),
65 redis.set(`${key}:ctype`, contentType, 'EX', TTL_SECONDS),
66 ]);
67}
68
69// Fetch image with timeout and size limits
70async function fetchImage(

Callers 2

getFaviconFunction · 0.85
getOgImageFunction · 0.85

Calls 3

getRedisCacheFunction · 0.90
setMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected