( lockKey: string, value: string, expirySeconds: number )
| 266 | * Redis never held a real lock, so heartbeat success is implicit. |
| 267 | */ |
| 268 | export async function extendLock( |
| 269 | lockKey: string, |
| 270 | value: string, |
| 271 | expirySeconds: number |
| 272 | ): Promise<boolean> { |
| 273 | const redis = getRedisClient() |
| 274 | if (!redis) { |
| 275 | return true |
| 276 | } |
| 277 | |
| 278 | const result = await redis.eval(EXTEND_LOCK_SCRIPT, 1, lockKey, value, expirySeconds) |
| 279 | return result === 1 |
| 280 | } |
| 281 | |
| 282 | /** |
| 283 | * Close the Redis connection. |
no test coverage detected