Ejemplo n.º 1
0
func hasAttempted(req request.Request, endpoint endpoint.Endpoint) bool {
	for _, a := range req.GetAttempts() {
		if a.GetEndpoint().GetId() == endpoint.GetId() {
			return true
		}
	}
	return false
}
Ejemplo n.º 2
0
// Failover in case if last attempt resulted in error
func IsNetworkError(req request.Request) bool {
	attempts := len(req.GetAttempts())
	return attempts != 0 && req.GetAttempts()[attempts-1].GetError() != nil
}