(
cacheName: string,
bucket: string,
path: string,
region: string,
onError?: (error: any, msg: string) => void,
)
| 44 | private readonly onError: (error: any, msg: string) => void; |
| 45 | |
| 46 | constructor( |
| 47 | cacheName: string, |
| 48 | bucket: string, |
| 49 | path: string, |
| 50 | region: string, |
| 51 | onError?: (error: any, msg: string) => void, |
| 52 | ) { |
| 53 | super(cacheName, `S3Cache(s3://${bucket}/${path} in ${region})`, 's3'); |
| 54 | this.path = path; |
| 55 | this.region = region; |
| 56 | this.s3 = new S3Bucket(bucket, region); |
| 57 | this.onError = |
| 58 | onError || |
| 59 | ((e, op) => { |
| 60 | SentryCapture(e, 'S3Cache onError'); |
| 61 | logger.error(`Error while trying to ${op} S3 cache: ${messageFor(e)}`); |
| 62 | }); |
| 63 | } |
| 64 | |
| 65 | override async getInternal(key: string): Promise<GetResult> { |
| 66 | try { |
nothing calls this directly
no test coverage detected