Skip to content

Commit

Permalink
Abort health check loop on done context (#555)
Browse files Browse the repository at this point in the history
Co-authored-by: Stephen Cathcart <stephen.cathcart@neotechnology.com>
  • Loading branch information
robsdedude and StephenCathcart authored Dec 14, 2023
1 parent ddb0635 commit ac6a50b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions neo4j/internal/pool/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ func (s *server) healthCheck(
if itime.Since(connection.IdleDate()) > idlenessTimeout {
connection.ForceReset(ctx)
if !connection.IsAlive() {
return false, nil
return false, ctx.Err()
}
}
if err := connection.ReAuth(ctx, auth); err != nil {
return false, err
}
if !connection.IsAlive() {
return false, nil
return false, ctx.Err()
}
// Update round-robin counter every time we give away a connection and keep track
// of our own round-robin index
Expand Down

0 comments on commit ac6a50b

Please sign in to comment.