Skip to content

Commit

Permalink
Set a timeout for all http queries
Browse files Browse the repository at this point in the history
Fixes #219
  • Loading branch information
simulot committed May 23, 2024
1 parent f8e7b42 commit bb59770
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions docs/releases.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Release notes

### Feat: [[#249](https://github.com/simulot/immich-go/issues/249)] Fix Display the path of log file name

The log file's name is displayed at exection end.


## Release 0.14.1

### [#246](https://github.com/simulot/immich-go/issues/246) Google Takeout 403 Forbidden on non admin user
Expand Down
13 changes: 11 additions & 2 deletions immich/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,19 @@ func NewImmichClient(endPoint string, key string, sslVerify bool) (*ImmichClient
}

// Create a custom HTTP client with SSL verification disabled
// Add timeouts for #219
// Info at https://www.loginradius.com/blog/engineering/tune-the-go-http-client-for-high-performance/
transportOptions := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: sslVerify},
MaxIdleConns: 100,
IdleConnTimeout: 90 * time.Second,
TLSClientConfig: &tls.Config{InsecureSkipVerify: sslVerify},
MaxIdleConnsPerHost: 100,
MaxConnsPerHost: 100,
}
tlsClient := &http.Client{
Timeout: time.Second * 10,
Transport: transportOptions,
}
tlsClient := &http.Client{Transport: transportOptions}

ic := ImmichClient{
endPoint: endPoint + "/api",
Expand Down

0 comments on commit bb59770

Please sign in to comment.