What's Changed
Enable use of idle connection pruning by @gwynne in #225
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; specifyingnil
disables idle pruning entirely. ThemaxIdleTimeBeforePruning
controls how long a connection must go unused before being pruned.
Reviewers
Thanks to the reviewers for their help:
This patch was released by @gwynne
Full Changelog: 2.10.1...2.11.0