diff options
author | Valery Piashchynski <[email protected]> | 2021-02-16 22:08:50 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-02-16 22:08:50 +0300 |
commit | 8aa3d83f8c9471519a02f7779219238340fb86f8 (patch) | |
tree | 1d74b888a3793e3b3ac699913da45a603afe1625 /pkg | |
parent | bb9dd8d3f46da089217e61efc3f058cfbba5ede3 (diff) |
Add support for parsing env variables in the `.rr.yaml` config
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'pkg')
-rwxr-xr-x | pkg/pool/supervisor_pool.go | 3 | ||||
-rwxr-xr-x | pkg/worker_watcher/worker_watcher.go | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/pkg/pool/supervisor_pool.go b/pkg/pool/supervisor_pool.go index 3618786d..bfb997d8 100755 --- a/pkg/pool/supervisor_pool.go +++ b/pkg/pool/supervisor_pool.go @@ -139,7 +139,8 @@ func (sp *supervised) control() { now := time.Now() const op = errors.Op("supervised_pool_control_tick") - // THIS IS A COPY OF WORKERS + // MIGHT BE OUTDATED + // It's a copy of the Workers pointers workers := sp.pool.Workers() for i := 0; i < len(workers); i++ { diff --git a/pkg/worker_watcher/worker_watcher.go b/pkg/worker_watcher/worker_watcher.go index 804e4658..cc8cc2b6 100755 --- a/pkg/worker_watcher/worker_watcher.go +++ b/pkg/worker_watcher/worker_watcher.go @@ -216,8 +216,8 @@ func (ww *workerWatcher) Destroy(ctx context.Context) { // Warning, this is O(n) operation, and it will return copy of the actual workers func (ww *workerWatcher) List() []worker.BaseProcess { - ww.Lock() - defer ww.Unlock() + ww.RLock() + defer ww.RUnlock() base := make([]worker.BaseProcess, 0, len(ww.workers)) for i := 0; i < len(ww.workers); i++ { |