Beispiel #1
0
func (c *Client) send(method, path string, in, out interface{}) (err error) {
	for startTime := time.Now(); time.Since(startTime) < 10*time.Second; time.Sleep(100 * time.Millisecond) {
		err = c.Send(method, path, in, out)
		if !httphelper.IsRetryableError(err) {
			break
		}
	}
	return
}
Beispiel #2
0
func isRetryable(err error) bool {
	switch err.(type) {
	case *net.OpError:
		return true
	case *url.Error:
		return true
	}
	if err == io.EOF {
		return true
	}
	return hh.IsRetryableError(err)
}