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

Function cacheWalLsnForSession

packages/db/src/session-consistency.ts:59–69  ·  view source on GitHub ↗
(
  sessionId: string,
  lsn: string,
)

Source from the content-addressed store, hash-verified

57}
58
59async function cacheWalLsnForSession(
60 sessionId: string,
61 lsn: string,
62): Promise<void> {
63 try {
64 const redis = getRedisCache();
65 await redis.setex(`${LSN_CACHE_PREFIX}${sessionId}`, LSN_CACHE_TTL, lsn);
66 } catch (error) {
67 logger.error({ err: error, sessionId }, 'Failed to cache WAL LSN');
68 }
69}
70
71async function getCachedWalLsn(sessionId: string): Promise<string | null> {
72 try {

Callers 1

sessionConsistencyFunction · 0.85

Calls 2

getRedisCacheFunction · 0.90
errorMethod · 0.45

Tested by

no test coverage detected