Skip to content

Commit 926da15

Browse files
authored
Fixed connection closed or lost. (#393)
* Fixed connection closed or lost. * Fixed duplicated check.
1 parent 2fb8dca commit 926da15

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Added `cleanup_indexes` command to clean up outdated indexes and inaccessible repositories.
1313

14+
### Fixed
15+
16+
- Fixed connection closed or lost on `ConnectionPool` by using `check_connection` to verify if the connection is still working.
17+
1418
## [0.1.4] - 2025-05-22
1519

1620
### Added

daiv/daiv/settings/components/database.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"DB_SSLMODE",
99
default="require",
1010
cast=Choices(["disable", "allow", "prefer", "require", "verify-ca", "verify-full"]),
11-
)
11+
),
12+
"pool": {"max_size": config("DB_POOL_MAX_SIZE", default=15, cast=int)},
1213
}
1314

1415
DATABASES = {
@@ -20,6 +21,7 @@
2021
"HOST": config("DB_HOST", default="localhost"),
2122
"PORT": config("DB_PORT", default=5432, cast=int),
2223
"OPTIONS": DATABASES_OPTIONS,
24+
"CONN_HEALTH_CHECKS": True,
2325
}
2426
}
2527

0 commit comments

Comments
 (0)