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

Function getCachedWalLsn

packages/db/src/session-consistency.ts:71–79  ·  view source on GitHub ↗
(sessionId: string)

Source from the content-addressed store, hash-verified

69}
70
71async function getCachedWalLsn(sessionId: string): Promise<string | null> {
72 try {
73 const redis = getRedisCache();
74 return await redis.get(`${LSN_CACHE_PREFIX}${sessionId}`);
75 } catch (error) {
76 logger.error({ err: error, sessionId }, 'Failed to get cached WAL LSN');
77 return null;
78 }
79}
80
81function compareWalLsn(lsn1: string, lsn2: string): number {
82 const [x1, y1] = lsn1.split('/').map((x) => BigInt(`0x${x}`));

Callers 2

waitForReplicaCatchupFunction · 0.85
sessionConsistencyFunction · 0.85

Calls 3

getRedisCacheFunction · 0.90
getMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected