Stop stops running the current configuration. It is the antithesis of Run(). This function will log any errors that occur during the stopping of individual apps and continue to stop the others. Stop should only be called if not replacing with a new config.
()
| 692 | // stop the others. Stop should only be called |
| 693 | // if not replacing with a new config. |
| 694 | func Stop() error { |
| 695 | currentCtxMu.RLock() |
| 696 | ctx := currentCtx |
| 697 | currentCtxMu.RUnlock() |
| 698 | |
| 699 | rawCfgMu.Lock() |
| 700 | unsyncedStop(ctx) |
| 701 | |
| 702 | currentCtxMu.Lock() |
| 703 | currentCtx = Context{} |
| 704 | currentCtxMu.Unlock() |
| 705 | |
| 706 | rawCfgJSON = nil |
| 707 | rawCfgIndex = nil |
| 708 | rawCfg[rawConfigKey] = nil |
| 709 | rawCfgMu.Unlock() |
| 710 | |
| 711 | return nil |
| 712 | } |
| 713 | |
| 714 | // unsyncedStop stops ctx from running, but has |
| 715 | // no locking around ctx. It is a no-op if ctx has a |
no test coverage detected