Skip to content

Commit 1176834

Browse files
committed
fix: add connection timeout and keep-alive settings to HTTP client
1 parent 6e1193e commit 1176834

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

immich/client.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package immich
33
import (
44
"crypto/tls"
55
"io"
6+
"net"
67
"net/http"
78
"os"
89
"sync"
@@ -97,6 +98,10 @@ func NewImmichClient(endPoint string, key string, options ...clientOption) (*Imm
9798
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
9899
MaxIdleConnsPerHost: 100,
99100
MaxConnsPerHost: 100,
101+
Dial: (&net.Dialer{
102+
Timeout: 10 * time.Second,
103+
KeepAlive: 30 * time.Second,
104+
}).Dial,
100105
},
101106
key: key,
102107
DeviceUUID: deviceUUID,

0 commit comments

Comments
 (0)