mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-01-17 08:24:26 +00:00
feat(dbmanager): ✨ update health check interval and add tests
* Change default health check interval from 30s to 15s. * Always start background health checks regardless of auto-reconnect setting. * Add tests for health checker functionality and default configurations.
This commit is contained in:
@@ -219,9 +219,10 @@ func (m *connectionManager) Connect(ctx context.Context) error {
|
||||
logger.Info("Database connection established: name=%s, type=%s", name, connCfg.Type)
|
||||
}
|
||||
|
||||
// Start background health checks if enabled
|
||||
if m.config.EnableAutoReconnect && m.config.HealthCheckInterval > 0 {
|
||||
// Always start background health checks
|
||||
if m.config.HealthCheckInterval > 0 {
|
||||
m.startHealthChecker()
|
||||
logger.Info("Background health checker started: interval=%v", m.config.HealthCheckInterval)
|
||||
}
|
||||
|
||||
logger.Info("Database manager initialized: connections=%d", len(m.connections))
|
||||
|
||||
Reference in New Issue
Block a user