suspend stops the controller from processing events if it's not the leader
()
| 83 | |
| 84 | // suspend stops the controller from processing events if it's not the leader |
| 85 | func (c *Controller) suspend() { |
| 86 | c.mu.Lock() |
| 87 | for key, cluster := range c.clusters { |
| 88 | cluster.Close() |
| 89 | delete(c.clusters, key) |
| 90 | } |
| 91 | c.mu.Unlock() |
| 92 | } |
| 93 | |
| 94 | // resume starts the controller to process events |
| 95 | func (c *Controller) resume(ctx context.Context) error { |