mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-01-17 16:34:25 +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:
@@ -128,7 +128,7 @@ func DefaultManagerConfig() ManagerConfig {
|
||||
RetryAttempts: 3,
|
||||
RetryDelay: 1 * time.Second,
|
||||
RetryMaxDelay: 10 * time.Second,
|
||||
HealthCheckInterval: 30 * time.Second,
|
||||
HealthCheckInterval: 15 * time.Second,
|
||||
EnableAutoReconnect: true,
|
||||
}
|
||||
}
|
||||
@@ -161,6 +161,11 @@ func (c *ManagerConfig) ApplyDefaults() {
|
||||
if c.HealthCheckInterval == 0 {
|
||||
c.HealthCheckInterval = defaults.HealthCheckInterval
|
||||
}
|
||||
// EnableAutoReconnect defaults to true - apply if not explicitly set
|
||||
// Since this is a boolean, we apply the default unconditionally when it's false
|
||||
if !c.EnableAutoReconnect {
|
||||
c.EnableAutoReconnect = defaults.EnableAutoReconnect
|
||||
}
|
||||
}
|
||||
|
||||
// Validate validates the manager configuration
|
||||
|
||||
Reference in New Issue
Block a user