SetMaxIterationsForInstance updates max iterations for a specific running loop.
(name string, maxIter int)
| 554 | |
| 555 | // SetMaxIterationsForInstance updates max iterations for a specific running loop. |
| 556 | func (m *Manager) SetMaxIterationsForInstance(name string, maxIter int) error { |
| 557 | m.mu.RLock() |
| 558 | instance, exists := m.instances[name] |
| 559 | m.mu.RUnlock() |
| 560 | |
| 561 | if !exists { |
| 562 | return fmt.Errorf("PRD %s not found", name) |
| 563 | } |
| 564 | |
| 565 | instance.mu.Lock() |
| 566 | defer instance.mu.Unlock() |
| 567 | |
| 568 | if instance.Loop != nil { |
| 569 | instance.Loop.SetMaxIterations(maxIter) |
| 570 | } |
| 571 | |
| 572 | return nil |
| 573 | } |
no test coverage detected