Skip to content

feat(database): Expose DB connection max idle time configuration#113

Merged
allisson merged 1 commit intomainfrom
expose-db-config
Mar 7, 2026
Merged

feat(database): Expose DB connection max idle time configuration#113
allisson merged 1 commit intomainfrom
expose-db-config

Conversation

@allisson
Copy link
Owner

@allisson allisson commented Mar 7, 2026

Currently, the database connection pool settings allow for configuring max open connections, max idle connections, and max lifetime, but not the max idle time.

Expose the DB_CONN_MAX_IDLE_TIME_MINUTES environment variable to provide better control over how long idle connections are kept in the pool before being closed.

  • Add DBConnMaxIdleTime to configuration with a default of 5 minutes
  • Update internal/app/di.go to apply the setting to the database pool
  • Document the new setting in docs/configuration.md
  • Update .env.example with the new variable

Currently, the database connection pool settings allow for configuring
max open connections, max idle connections, and max lifetime, but not
the max idle time.

Expose the `DB_CONN_MAX_IDLE_TIME_MINUTES` environment variable to
provide better control over how long idle connections are kept in the
pool before being closed.

- Add `DBConnMaxIdleTime` to configuration with a default of 5 minutes
- Update `internal/app/di.go` to apply the setting to the database pool
- Document the new setting in `docs/configuration.md`
- Update `.env.example` with the new variable
@allisson allisson merged commit e91a4f2 into main Mar 7, 2026
3 checks passed
@allisson allisson deleted the expose-db-config branch March 7, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant