Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Enable use of idle connection pruning #225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
gwynne merged 2 commits into main from support-idle-pruning
Aug 26, 2025
Merged

Enable use of idle connection pruning #225

gwynne merged 2 commits into main from support-idle-pruning
Aug 26, 2025

Conversation

Copy link
Member

@gwynne gwynne commented Aug 25, 2025
edited by penny-for-vapor bot
Loading

These changes are now available in 2.11.0

AsyncKit 1.21.0 added support for automatic pruning of idle database connections in the connection pool. This PR adds the necessary configuration parameters to the Postgres driver, enabling Fluent users to take advantage of this new functionality:

app.databases.use(.postgres(
 url: "postgres://user@pass:host/db",
 pruningInterval: .minutes(1),
 maxIdleTimeBeforePruning: .minutes(10)
), as: .psql)

The pruningInterval controls how often the pool will check for idle connections; specifying nil disables idle pruning entirely. The maxIdleTimeBeforePruning controls how long a connection must go unused before being pruned.

@gwynne gwynne added the semver-minor Contains new APIs label Aug 25, 2025
@gwynne gwynne force-pushed the support-idle-pruning branch from ace9e0b to 3c55d3c Compare August 25, 2025 17:13
Copy link

codecov bot commented Aug 25, 2025
edited
Loading

Codecov Report

❌ Patch coverage is 8.53659% with 75 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.23%. Comparing base (fd57101) to head (dc0d053).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ntPostgresDriver/FluentPostgresConfiguration.swift 6.25% 75 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@
## main #225 +/- ##
==========================================
- Coverage 63.39% 54.23% -9.16% 
==========================================
 Files 8 8 
 Lines 336 437 +101 
==========================================
+ Hits 213 237 +24 
- Misses 123 200 +77 
Files with missing lines Coverage Δ
.../FluentPostgresDriver/FluentPostgresDatabase.swift 80.21% <100.00%> (-0.87%) ⬇️
...uentPostgresDriver/PostgresConverterDelegate.swift 88.09% <100.00%> (ø)
...ntPostgresDriver/FluentPostgresConfiguration.swift 20.68% <6.25%> (-16.08%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

...pruning support in AsyncKit 1.21.0, enabling direct use by Fluent users.
@gwynne gwynne force-pushed the support-idle-pruning branch from 3c55d3c to d889fe8 Compare August 25, 2025 17:23
@gwynne gwynne merged commit cd47a70 into main Aug 26, 2025
5 checks passed
@gwynne gwynne deleted the support-idle-pruning branch August 26, 2025 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@MahdiBM MahdiBM MahdiBM approved these changes

@0xTim 0xTim Awaiting requested review from 0xTim

@ptoffy ptoffy Awaiting requested review from ptoffy

Assignees
No one assigned
Labels
semver-minor Contains new APIs
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /