schmorrison / Zoho

Golang API for Zoho services
MIT License
35 stars 34 forks source link

Using Retryable HTTP instead of normal http. #36

Closed ysahil97 closed 2 years ago

ysahil97 commented 2 years ago

Hi schmorrison

I have been using this zoho library extensively for about 6 months in our backend which is very beneficial for golang users. I have noticed that at some days, the requests made by this library sometimes face timeouts of various types like connection timeout, i/o timeout and HTTP handshake timeout. In worse cases, these timeout become very frequent and can be an issue for backend users.

I have just got to know about https://github.com/hashicorp/go-retryablehttp which is a wrapper over net/http package to handle retries in case of time outs.

I surely believe that the inclusion of this library would make zoho package more resilient in terms of timeouts. For starters, we can have number of retries to be 1 to ensure similar functionality.

What do you think about this idea?

schmorrison commented 2 years ago

Thanks for this PR!!

I am happy with the look of the github.com/hashicorp/go-retryablehttp and will review the changes shortly.