diff --git a/lib/src/pool/pool_impl.dart b/lib/src/pool/pool_impl.dart index 3758bc16..5be688b8 100644 --- a/lib/src/pool/pool_impl.dart +++ b/lib/src/pool/pool_impl.dart @@ -198,7 +198,6 @@ class PoolImplementation implements Pool { // flag is set, otherwise race conditions may create conflicts or // pool close may miss the connection. _connections.add(newc); - print(_connections.length); return newc; } } @@ -230,13 +229,13 @@ class _PoolConnection implements Connection { bool _isExpired() { final age = DateTime.now().difference(_opened); - if (age > _pool._settings.maxConnectionAge) { + if (age >= _pool._settings.maxConnectionAge) { return true; } - if (_elapsedInUse > _pool._settings.maxSessionUse) { + if (_elapsedInUse >= _pool._settings.maxSessionUse) { return true; } - if (_queryCount > _pool._settings.maxQueryCount) { + if (_queryCount >= _pool._settings.maxQueryCount) { return true; } return false; diff --git a/lib/src/v3/connection.dart b/lib/src/v3/connection.dart index b476beb2..308dfa3f 100644 --- a/lib/src/v3/connection.dart +++ b/lib/src/v3/connection.dart @@ -290,12 +290,12 @@ class PgConnectionImplementation extends _PgSessionBase implements Connection { // transaction and should be reporte to the user. _TransactionSession? _activeTransaction; - final Map _parameters = {}; + final _parameters = {}; var _statementCounter = 0; var _portalCounter = 0; - late final _Channels _channels = _Channels(this); + late final _channels = _Channels(this); @override Channels get channels => _channels; @@ -364,7 +364,7 @@ class PgConnectionImplementation extends _PgSessionBase implements Connection { // Unlike runTx, this doesn't need any locks. An active transaction changes // the state of the connection, this method does not. If methods requiring // locks are called by [fn], these methods will aquire locks as needed. - return Future.sync(() => fn(session)); + return Future(() => fn(session)); } @override diff --git a/pubspec.yaml b/pubspec.yaml index f34984e5..153fe280 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: postgres description: PostgreSQL database driver. Supports statement reuse and binary protocol and connection pooling. -version: 3.0.0-beta.1 +version: 3.0.0-rc.1 homepage: https://github.com/isoos/postgresql-dart topics: - sql