Explorar el Código

update attempts

Chris Bannister hace 10 años
padre
commit
bec525bec1
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3 2
      session.go

+ 3 - 2
session.go

@@ -272,6 +272,7 @@ func (s *Session) executeQuery(qry *Query) *Iter {
 	for {
 		host, conn := s.pool.Pick(qry)
 
+		qry.attempts++
 		//Assign the error unavailable to the iterator
 		if conn == nil {
 			if qry.rt == nil || !qry.rt.Attempt(qry) {
@@ -285,11 +286,11 @@ func (s *Session) executeQuery(qry *Query) *Iter {
 		t := time.Now()
 		iter = conn.executeQuery(qry)
 		qry.totalLatency += time.Now().Sub(t).Nanoseconds()
-		qry.attempts++
 
 		//Exit for loop if the query was successful
 		if iter.err == nil {
-			host.Mark(iter.err)
+			iter.host = conn.host
+			host.Mark(nil)
 			break
 		}