Clone creates a deep copy of the configuration.
()
| 319 | |
| 320 | // Clone creates a deep copy of the configuration. |
| 321 | func (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 |
| 346 | func (c *Config) applyWorkerDefaults(poolSize int) { |