Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ Write the date in place of the "Unreleased" in the case a new version is release

## Unreleased

### Added

- Configured recycle and added explicit pre-ping option (disabled by default) for
storage databases.

### Fixed

- Column names in `TableStructure` are explicitly converted to strings.
Expand Down
8 changes: 6 additions & 2 deletions tiled/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,12 @@ def _connection_pool(self) -> "sqlalchemy.pool.QueuePool":
if (self.dialect == "duckdb") or (":memory:" in self.uri):
pool = sqlalchemy.pool.StaticPool(creator)
else:
pool = sqlalchemy.pool.QueuePool(
creator, pool_size=self.pool_size, max_overflow=self.max_overflow
return sqlalchemy.pool.QueuePool(
creator,
pool_size=self.pool_size,
max_overflow=self.max_overflow,
recycle=1800, # Recycle connections after 30 minutes
pre_ping=False, # Default -- don't test connections before using them
)
monitor_db_pool(pool, self.uri)

Expand Down