Skip to content

4.8.0 - Enable use of idle connection pruning

Latest

Choose a tag to compare

@penny-for-vapor penny-for-vapor released this 26 Aug 15:03
4d8f31a

What's Changed

Enable use of idle connection pruning by @gwynne in #230

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 MySQL driver, enabling Fluent users to take advantage of this new functionality:

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

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: 4.7.1...4.8.0