Skip to content

Commit b924320

Browse files
committed
chore: Pass retryStrategy
1 parent 9e868ac commit b924320

File tree

1 file changed

+4
-5
lines changed
  • packages/artisan/src/lib

1 file changed

+4
-5
lines changed

packages/artisan/src/lib/s3.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { env } from "../env";
99
import type { PutObjectCommandInput } from "@aws-sdk/client-s3";
1010
import type { CommandInput } from "s3-sync-client";
1111

12+
const retryStrategy = new ConfiguredRetryStrategy(5, 60_000);
13+
1214
const client = new S3({
1315
endpoint: env.S3_ENDPOINT,
1416
region: env.S3_REGION,
@@ -17,13 +19,10 @@ const client = new S3({
1719
secretAccessKey: env.S3_SECRET_KEY,
1820
},
1921
logger: console,
20-
retryStrategy: new ConfiguredRetryStrategy(
21-
10,
22-
(attempt) => 1000 + attempt * 1000,
23-
),
22+
retryStrategy,
2423
});
2524

26-
const { sync } = new S3SyncClient({ client });
25+
const { sync } = new S3SyncClient({ client, retryStrategy });
2726

2827
export async function syncFromS3(remotePath: string, localPath: string) {
2928
await sync(`s3://${env.S3_BUCKET}/${remotePath}`, localPath);

0 commit comments

Comments
 (0)