neo4j / neo4j-dotnet-driver

Neo4j Bolt driver for .NET
Apache License 2.0
226 stars 69 forks source link

Liveness check #756

Closed thelonelyvulpes closed 9 months ago

thelonelyvulpes commented 9 months ago

This change introduces a liveness check timeout.

using var driver = GraphDatabase.Driver(uri, creds, 
    cb => cb.WithConnectionLivenessCheckTimeout(TimeSpan.FromSeconds(30));

Using a timeout of 0, all connections will complete a liveness check when taken from the pool; this ensures connections are healthy but comes at the cost of performance when running queries or starting transactions.