discontinuedPackage connect_database has been discontinued.

startHealthCheck method

void startHealthCheck({
  1. Duration interval = _PoolConstants.defaultHealthCheckInterval,
})

Starts periodic health check of all available connections. Stale connections are automatically removed from the pool. interval - Time between health checks (default: 5 minutes)

Implementation

void startHealthCheck({Duration interval = _PoolConstants.defaultHealthCheckInterval}) {
  stopHealthCheck(); // Stop any existing timer
  _healthCheckTimer = Timer.periodic(interval, (_) => _validateAllConnections());
}