( sessionId: string, lsn: string, )
| 57 | } |
| 58 | |
| 59 | async 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 | |
| 71 | async function getCachedWalLsn(sessionId: string): Promise<string | null> { |
| 72 | try { |
no test coverage detected