(
normalizedKey: string,
storageMethod: 'redis' | 'database'
)
| 391 | } |
| 392 | |
| 393 | private async deleteKey( |
| 394 | normalizedKey: string, |
| 395 | storageMethod: 'redis' | 'database' |
| 396 | ): Promise<void> { |
| 397 | if (storageMethod === 'redis') { |
| 398 | const redis = getRedisClient() |
| 399 | if (redis) await redis.del(`${REDIS_KEY_PREFIX}${normalizedKey}`).catch(() => {}) |
| 400 | } else { |
| 401 | await db |
| 402 | .delete(idempotencyKey) |
| 403 | .where(eq(idempotencyKey.key, normalizedKey)) |
| 404 | .catch(() => {}) |
| 405 | } |
| 406 | } |
| 407 | |
| 408 | async executeWithIdempotency<T>( |
| 409 | provider: string, |
no test coverage detected