MCPcopy
hub / github.com/redis/go-redis / Clone

Method Clone

maintnotifications/config.go:321–343  ·  view source on GitHub ↗

Clone creates a deep copy of the configuration.

()

Source from the content-addressed store, hash-verified

319
320// Clone creates a deep copy of the configuration.
321func (c *Config) Clone() *Config {
322 if c == nil {
323 return DefaultConfig()
324 }
325
326 return &Config{
327 Mode: c.Mode,
328 EndpointType: c.EndpointType,
329 RelaxedTimeout: c.RelaxedTimeout,
330 HandoffTimeout: c.HandoffTimeout,
331 MaxWorkers: c.MaxWorkers,
332 HandoffQueueSize: c.HandoffQueueSize,
333 PostHandoffRelaxedDuration: c.PostHandoffRelaxedDuration,
334
335 // Circuit breaker configuration
336 CircuitBreakerFailureThreshold: c.CircuitBreakerFailureThreshold,
337 CircuitBreakerResetTimeout: c.CircuitBreakerResetTimeout,
338 CircuitBreakerMaxRequests: c.CircuitBreakerMaxRequests,
339
340 // Configuration fields
341 MaxHandoffRetries: c.MaxHandoffRetries,
342 }
343}
344
345// applyWorkerDefaults calculates and applies worker defaults based on pool size
346func (c *Config) applyWorkerDefaults(poolSize int) {

Calls 1

DefaultConfigFunction · 0.85