Ver Fonte

mark the selected host with the real query response

Thomas Adam há 10 anos atrás
pai
commit
87aebe4598
1 ficheiros alterados com 4 adições e 5 exclusões
  1. 4 5
      session.go

+ 4 - 5
session.go

@@ -286,15 +286,14 @@ func (s *Session) executeQuery(qry *Query) *Iter {
 		iter = conn.executeQuery(qry)
 		qry.totalLatency += time.Now().Sub(t).Nanoseconds()
 
-		//Exit for loop if the query was successful
+		// Update host
+		host.Mark(iter.err)
+
+		// Exit for loop if the query was successful
 		if iter.err == nil {
-			host.Mark(nil)
 			break
 		}
 
-		// Mark host as ok
-		host.Mark(nil)
-
 		if qry.rt == nil || !qry.rt.Attempt(qry) {
 			break
 		}