Skip to content

Commit

Permalink
fix: Attach finalizer on commit (#186)
Browse files Browse the repository at this point in the history
* fix: Attach finalizer on commit

* check connections

* chore(release): publish packages

 - conduit_core@4.2.1-rc.1
  • Loading branch information
j4qfrost committed Feb 1, 2023
1 parent f8e2372 commit 8408280
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
env:
POSTGRES_USER: conduit_test_user
POSTGRES_PASSWORD: conduit!
PGPASSWORD: conduit!
POSTGRES_DB: conduit_test_db
POSTGRES_PORT: 15432
ports:
Expand All @@ -65,4 +66,4 @@ jobs:
dart pub get --directory=packages/runtime_test_packages/dependency --offline
- name: Run tests
working-directory: ${{ env.TEST_DIR }}
run: . ../../ci/.env && ${{ matrix.runner_args }}
run: . ../../ci/.env && ${{ matrix.runner_args }} && psql -p15432 -U conduit_test_user -h 127.0.0.1 -c "SELECT * FROM pg_stat_activity;"
2 changes: 1 addition & 1 deletion packages/common_test/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ dependencies:
conduit_common: ^4.2.1
conduit_core: ^4.2.1
dev_dependencies:
lints: ^2.0.1
lints: ^2.0.1
5 changes: 5 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 4.2.1-rc.1

- finalize on close

- **FIX**: Attach finalizer on commit. ([5343fc8a](https://github.com/conduit-dart/conduit/commit/5343fc8aac99f6269682f7619283815ff916d829))
## 4.2.1

- **REFACTOR**: Bump min required dart version ([#187](https://github.com/conduit-dart/conduit/issues/187)). ([0e870402](https://github.com/conduit-dart/conduit/commit/0e8704028d55d2e924aa72fa8e5e72711c8f4a07))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ class PostgreSQLPersistentStore extends PersistentStore
_databaseConnection = conn;
_pendingConnectionCompleter!.complete(_databaseConnection);
_pendingConnectionCompleter = null;
_finalizer.attach(this, _databaseConnection!, detach: this);
}).catchError((e) {
_pendingConnectionCompleter!.completeError(
QueryException.transport(
Expand All @@ -139,8 +140,6 @@ class PostgreSQLPersistentStore extends PersistentStore
return _pendingConnectionCompleter!.future;
}

_finalizer.attach(this, _databaseConnection!, detach: this);

return _databaseConnection!;
}

Expand Down

0 comments on commit 8408280

Please sign in to comment.