internal void Clear() { NpgsqlConnector[] idleConnectors; lock (this) { idleConnectors = Idle.ToArray(); Idle.Clear(); EnsurePruningTimerState(); } foreach (var connector in idleConnectors) { try { connector.Close(); } catch (Exception e) { Log.Warn("Exception while closing connector during clear", e, connector.Id); } } _clearCounter++; }
internal void Clear() { NpgsqlConnector[] idleConnectors; lock (this) { idleConnectors = Idle.ToArray(); Idle.Clear(); EnsurePruningTimerState(); } foreach (var connector in idleConnectors) { Counters.NumberOfPooledConnections.Decrement(); Counters.NumberOfFreeConnections.Decrement(); try { connector.Close(); } catch (Exception e) { Log.Logger.LogWarning(NpgsqlEventId.ExceptionClearingConnector, e, "[{ConnectorId}] Exception while closing connector during clear", connector.Id); } } _clearCounter++; }