add a timeout to http client
This commit is contained in:
@@ -71,14 +71,14 @@ func (s *ServerManager) testConnectionAndCreateClient(connection ServerConnectio
|
|||||||
|
|
||||||
func (s *ServerManager) connect(connection ServerConnection, password string) (*subsonic.Client, error) {
|
func (s *ServerManager) connect(connection ServerConnection, password string) (*subsonic.Client, error) {
|
||||||
cli := &subsonic.Client{
|
cli := &subsonic.Client{
|
||||||
Client: &http.Client{},
|
Client: &http.Client{Timeout: 10 * time.Second},
|
||||||
BaseUrl: connection.Hostname,
|
BaseUrl: connection.Hostname,
|
||||||
User: connection.Username,
|
User: connection.Username,
|
||||||
PasswordAuth: connection.LegacyAuth,
|
PasswordAuth: connection.LegacyAuth,
|
||||||
ClientName: "supersonic",
|
ClientName: "supersonic",
|
||||||
}
|
}
|
||||||
altCli := &subsonic.Client{
|
altCli := &subsonic.Client{
|
||||||
Client: &http.Client{},
|
Client: &http.Client{Timeout: 10 * time.Second},
|
||||||
BaseUrl: connection.AltHostname,
|
BaseUrl: connection.AltHostname,
|
||||||
User: connection.Username,
|
User: connection.Username,
|
||||||
PasswordAuth: connection.LegacyAuth,
|
PasswordAuth: connection.LegacyAuth,
|
||||||
|
|||||||
Reference in New Issue
Block a user