MCPcopy Index your code
hub / github.com/compiler-explorer/compiler-explorer / constructor

Method constructor

lib/cache/s3.ts:46–63  ·  view source on GitHub ↗
(
        cacheName: string,
        bucket: string,
        path: string,
        region: string,
        onError?: (error: any, msg: string) => void,
    )

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 3

messageForFunction · 0.85
errorMethod · 0.80
SentryCaptureFunction · 0.50

Tested by

no test coverage detected