(sessionId: string)
| 69 | } |
| 70 | |
| 71 | async 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 | |
| 81 | function compareWalLsn(lsn1: string, lsn2: string): number { |
| 82 | const [x1, y1] = lsn1.split('/').map((x) => BigInt(`0x${x}`)); |
no test coverage detected