Skip to content

2.11.0 - Enable use of idle connection pruning

Latest
Compare
Choose a tag to compare
@penny-for-vapor penny-for-vapor released this 26 Aug 15:02
cd47a70

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; specifying nil disables idle pruning entirely. The maxIdleTimeBeforePruning 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