func (p *Pool) CleanUp() {
	p.serversMut.Lock()
	defer p.serversMut.Unlock()
	now := p.now()
	for n, s := range p.servers {
		s.removeIdleOlderThan(now, p.maxAge)
		if s.size() == 0 && !s.hasFailedConnect(now) {
			delete(p.servers, n)
		}
	}
}
Prune all old connection on all the servers, this makes sure that servers
gets removed from the map at some point in time. If there is a noticed
failed connect still active  we should wait a while with removal to get
prioritization right.
package pool
import (
	"container/list"
	"context"
	"errors"
	"fmt"
	"sort"
	"sync"
	"time"
	"github.com/neo4j/neo4j-go-driver/v4/neo4j/db"
	"github.com/neo4j/neo4j-go-driver/v4/neo4j/log"
)
type Connect func(string, log.BoltLogger) (db.Connection, error)
type qitem struct {
	servers []string
	wakeup  chan bool
	conn    db.Connection
}
type Pool struct {
	maxSize    int
	maxAge     time.Duration
	connect    Connect
	servers    map[string]*server
	serversMut sync.Mutex
	queueMut   sync.Mutex
	queue      list.List
	now        func() time.Time
	closed     bool
	log        log.Logger
	logId      string
}
type serverPenalty struct {
	name    string
	penalty uint32
}
func New(maxSize int, maxAge time.Duration, connect Connect, logger log.Logger, logId string) *Pool {
	if maxAge <= 0 {
		maxAge = 1<<63 - 1
	}
	p := &Pool{
		maxSize: maxSize,
		maxAge:  maxAge,
		connect: connect,
		servers: make(map[string]*server),
		now:     time.Now,
		logId:   logId,
		log:     logger,
	}
	p.log.Infof(log.Pool, p.logId, "Created")
	return p
}
func (p *Pool) Close() {
	p.closed = true
	p.queueMut.Lock()
	p.queue.Init()
	p.queueMut.Unlock()
	p.serversMut.Lock()
	for n, s := range p.servers {
		s.closeAll()
		delete(p.servers, n)
	}
	p.serversMut.Unlock()
	p.log.Infof(log.Pool, p.logId, "Closed")
}
func (p *Pool) anyExistingConnectionsOnServers(serverNames []string) bool {
	p.serversMut.Lock()
	defer p.serversMut.Unlock()
	for _, s := range serverNames {
		b := p.servers[s]
		if b != nil {
			if b.size() > 0 {
				return true
			}
		}
	}
	return false
}
func (p *Pool) queueSize() int {
	p.queueMut.Lock()
	defer p.queueMut.Unlock()
	return p.queue.Len()
}
func (p *Pool) getServers() map[string]*server {
	p.serversMut.Lock()
	defer p.serversMut.Unlock()
	servers := make(map[string]*server)
	for k, v := range p.servers {
		servers[k] = v
	}
	return servers
}