Skip to content

Commit 94db90b

Browse files
committed
fix: add a socket connection timeout
1 parent ed66a53 commit 94db90b

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"dependencies": {
2828
"@aws-sdk/client-s3": "^3.8.0",
2929
"@aws-sdk/lib-storage": "^3.8.0",
30+
"@aws-sdk/node-http-handler": "^3.6.1",
3031
"@supabase/postgrest-js": "^0.26.1",
3132
"dotenv": "^8.2.0",
3233
"fastify": "^3.14.0",

src/utils/s3.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@ import {
1515
ServiceOutputTypes,
1616
} from '@aws-sdk/client-s3'
1717
import { Upload } from '@aws-sdk/lib-storage'
18+
import { NodeHttpHandler } from '@aws-sdk/node-http-handler'
1819

1920
export function initClient(region: string, endpoint?: string | undefined): S3Client {
2021
const params: S3ClientConfig = {
2122
region,
2223
runtime: 'node',
24+
requestHandler: new NodeHttpHandler({
25+
socketTimeout: 300000,
26+
}),
2327
}
2428
if (endpoint) {
2529
params.endpoint = endpoint

0 commit comments

Comments
 (0)