ChimeraCoder / anaconda

A Go client library for the Twitter 1.1 API
MIT License
1.14k stars 247 forks source link

Enforce a default HTTP client timeout #226

Closed valeriansaliou closed 6 years ago

valeriansaliou commented 6 years ago

Golang default HTTP client has no timeout, which may dead-lock any wrapper mutex when used in a complex app, in case the network goes down or Twitter APIs take too much time to respond / are down.

See: https://medium.com/@nate510/don-t-use-go-s-default-http-client-4804cb19f779

Signed-off-by: Valerian Saliou valerian@valeriansaliou.name

ChimeraCoder commented 6 years ago

Thanks for the PR! Looks like this needs a gofmt.

valeriansaliou commented 6 years ago

@mywaystar was 8ed10a1 intended to be included in the PR? 7e276df was but unsure about 8ed10a1 - just making sure.

baptistejamin commented 6 years ago

8ed10a1 https://github.com/ChimeraCoder/anaconda/commit/8ed10a1c9deda1233e6adf96be04ba903859e136 was made recently. I’ll do a separate PR for this.

Baptiste Jamin CEO, Crisp https://crisp.im/ - Connect your customers to your team.

On 26 Feb 2018, at 07:55, Valerian Saliou notifications@github.com wrote:

@mywaystar https://github.com/mywaystar was 8ed10a1 https://github.com/ChimeraCoder/anaconda/commit/8ed10a1c9deda1233e6adf96be04ba903859e136 intended to be included in the PR? 7e276df https://github.com/ChimeraCoder/anaconda/commit/7e276dfa1dcbc3b73c0631045447716687f6c2f8 was but unsure about 8ed10a1 https://github.com/ChimeraCoder/anaconda/commit/8ed10a1c9deda1233e6adf96be04ba903859e136 - just making sure.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ChimeraCoder/anaconda/pull/226#issuecomment-368407144, or mute the thread https://github.com/notifications/unsubscribe-auth/AA04wyR1MeJxoAgJ1x1z0HLHChPXHtTNks5tYlVogaJpZM4QqMa1.