| 72 | } |
| 73 | |
| 74 | override async putInternal(key: string, value: Buffer, creator?: string): Promise<void> { |
| 75 | const options: S3HandlerOptions = { |
| 76 | metadata: creator ? {CreatedBy: creator} : {}, |
| 77 | redundancy: StorageClass.REDUCED_REDUNDANCY, |
| 78 | }; |
| 79 | try { |
| 80 | await this.s3.put(key, value, this.path, options); |
| 81 | } catch (e) { |
| 82 | this.onError(e, 'write'); |
| 83 | } |
| 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); |