diff options
author | Yuqian Yang <crupest@crupest.life> | 2025-06-21 23:00:56 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-06-21 23:00:56 +0800 |
commit | 3f5c388e8bc41b1b6d219743b125ef541efeed96 (patch) | |
tree | b16853c32d2dabfc1af7b1fb04dd019c69e8d680 /deno/mail-relay/aws | |
parent | 888650202daeed5c5b423013df9a629d36c3d007 (diff) | |
download | crupest-3f5c388e8bc41b1b6d219743b125ef541efeed96.tar.gz crupest-3f5c388e8bc41b1b6d219743b125ef541efeed96.tar.bz2 crupest-3f5c388e8bc41b1b6d219743b125ef541efeed96.zip |
mail: organize utils in namespace-like object. no logging cause.
Diffstat (limited to 'deno/mail-relay/aws')
-rw-r--r-- | deno/mail-relay/aws/fetch.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/deno/mail-relay/aws/fetch.ts b/deno/mail-relay/aws/fetch.ts index da8609f..34948d4 100644 --- a/deno/mail-relay/aws/fetch.ts +++ b/deno/mail-relay/aws/fetch.ts @@ -8,7 +8,7 @@ import { S3ClientConfig, } from "@aws-sdk/client-s3"; -import { toFileNameString } from "@crupest/base"; +import { DateUtils } from "@crupest/base"; import { Mail } from "../mail.ts"; @@ -98,7 +98,9 @@ export class AwsMailFetcher { rawMail = await res.Body.transformToString(); } catch (cause) { if (cause instanceof NoSuchBucket) { - console.error(`S3 mail key ${s3Key} not found. Perhaps already consumed?`) + console.error( + `S3 mail key ${s3Key} not found. Perhaps already consumed?`, + ); return; } throw cause; @@ -109,7 +111,7 @@ export class AwsMailFetcher { const { date } = new Mail(rawMail).parsed; const dateString = date != null - ? toFileNameString(date, true) + ? DateUtils.toFileNameString(date, true) : "invalid-date"; const newPath = `${this.#archivePrefix}${dateString}/${s3Key}`; |