go-plex-client icon indicating copy to clipboard operation
go-plex-client copied to clipboard

Make timeout configurable for all HTTP calls

Open eschizoid opened this issue 6 years ago • 2 comments

Rather than hardcoding the timeout (3 seconds), seems like a good idea to make this parameter configurable depending on the client needs.

eschizoid avatar Nov 25 '18 01:11 eschizoid

You can change it by accessing Plex.HTTPClient.Timeout directly. Like so:

plexConn, _ := plex.New("abc", "123")

plexConn.HTTPClient.Timeout = time.Minute * 1

But yeah, what's the best way to change the parameters? Like just add an extra argument? plex.New("abc", "123", 1 * time.Minute)

jrudio avatar Nov 25 '18 05:11 jrudio

@jrudio Not sure if it would be useful to just allow clients to configure the timeout. What you think about allowing clients to pass the whole http.Client reference?

eschizoid avatar Nov 25 '18 16:11 eschizoid