Explorar el Código

Return last error if can't retry on more hosts (#1213)

* Return last error if can't retry on more hosts
Jaume Marhuenda hace 7 años
padre
commit
2d1883bd2c
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      query_executor.go

+ 4 - 0
query_executor.go

@@ -152,6 +152,10 @@ func (q *queryExecutor) run(qry ExecutableQuery, specWG *sync.WaitGroup, results
 			case RetryNextHost:
 				// retry on the next host
 				selectedHost = hostIter()
+				if selectedHost == nil {
+					results <- queryResponse{iter: iter}
+					return
+				}
 				continue
 			default:
 				// Undefined? Return nil and error, this will panic in the requester