Skip to content

Commit 090a459

Browse files
Don't ignore close in the pool when using force (#406)
1 parent 7e6dfe4 commit 090a459

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 3.4.8
4+
5+
- Fix: Don't ignore de pool resource `close` call when using foce. [#406](https://github.com/isoos/postgresql-dart/pull/406) by [davidmartos96](https://github.com/davidmartos96).
6+
37
## 3.4.7
48

59
- Implemented `Pool.close(force: true)` (using [davidmartos96](https://github.com/davidmartos96)'s [#397](https://github.com/isoos/postgresql-dart/pull/397) as baseline).

lib/src/pool/pool_impl.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,12 @@ class _PoolConnection implements Connection {
282282

283283
@override
284284
Future<void> close({bool force = false}) async {
285-
// Don't forward the close call, the underlying connection should be re-used
285+
// Don't forward the close call unless forcing. The underlying connection should be re-used
286286
// when another pool connection is requested.
287287

288-
// TODO: Implement force close.
288+
if (force) {
289+
await _connection.close(force: force);
290+
}
289291
}
290292

291293
@override

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: postgres
22
description: PostgreSQL database driver. Supports statement reuse and binary protocol and connection pooling.
3-
version: 3.4.7
3+
version: 3.4.8
44
homepage: https://github.com/isoos/postgresql-dart
55
topics:
66
- sql

0 commit comments

Comments
 (0)