MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / putWithTTL

Method putWithTTL

lib/cache/s3.ts:86–98  ·  view source on GitHub ↗
(key: string, value: Buffer, ttlDays: number, creator?: string)

Source from the content-addressed store, hash-verified

84 }
85
86 async putWithTTL(key: string, value: Buffer, ttlDays: number, creator?: string): Promise<void> {
87 const expiresDate = new Date(Date.now() + ttlDays * 24 * 60 * 60 * 1000);
88 const options: S3HandlerOptions = {
89 metadata: creator ? {CreatedBy: creator} : {},
90 redundancy: StorageClass.REDUCED_REDUNDANCY,
91 expires: expiresDate,
92 };
93 try {
94 await this.s3.put(key, value, this.path, options);
95 } catch (e) {
96 this.onError(e, 'write');
97 }
98 }
99
100 async putWithTTLAndPath(
101 key: string,

Callers 1

cachePutWithTTLMethod · 0.80

Calls 1

putMethod · 0.65

Tested by

no test coverage detected