( key: string, buffer: Buffer, contentType: string, )
| 55 | } |
| 56 | |
| 57 | async function setToCacheBinary( |
| 58 | key: string, |
| 59 | buffer: Buffer, |
| 60 | contentType: string, |
| 61 | ): Promise<void> { |
| 62 | const redis = getRedisCache(); |
| 63 | await Promise.all([ |
| 64 | redis.set(key, buffer.toString('base64'), 'EX', TTL_SECONDS), |
| 65 | redis.set(`${key}:ctype`, contentType, 'EX', TTL_SECONDS), |
| 66 | ]); |
| 67 | } |
| 68 | |
| 69 | // Fetch image with timeout and size limits |
| 70 | async function fetchImage( |
no test coverage detected