Skip to content

Commit 527bb51

Browse files
committed
fix: increase timeout settings for HTTP client and response headers Fixes #928
1 parent 01ed80c commit 527bb51

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

immich/client.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ func OptionVerifySSL(verify bool) clientOption {
6565
func OptionConnectionTimeout(d time.Duration) clientOption {
6666
return func(ic *ImmichClient) error {
6767
ic.client.Timeout = d
68+
ic.client.Transport.(*http.Transport).ResponseHeaderTimeout = d
6869
return nil
6970
}
7071
}
@@ -99,11 +100,11 @@ func NewImmichClient(endPoint string, key string, options ...clientOption) (*Imm
99100
MaxIdleConnsPerHost: 100,
100101
MaxConnsPerHost: 100,
101102
Dial: (&net.Dialer{
102-
Timeout: 10 * time.Second,
103+
Timeout: 30 * time.Second,
103104
KeepAlive: 30 * time.Second,
104105
}).Dial,
105-
TLSHandshakeTimeout: 10 * time.Second,
106-
ResponseHeaderTimeout: 10 * time.Second,
106+
TLSHandshakeTimeout: 30 * time.Second,
107+
ResponseHeaderTimeout: 20 * time.Minute,
107108
},
108109
key: key,
109110
DeviceUUID: deviceUUID,
@@ -112,7 +113,7 @@ func NewImmichClient(endPoint string, key string, options ...clientOption) (*Imm
112113
}
113114

114115
ic.client = &http.Client{
115-
Timeout: time.Second * 60,
116+
Timeout: time.Minute * 20,
116117
Transport: ic.roundTripper,
117118
}
118119

0 commit comments

Comments
 (0)