Skip to content

Commit

Permalink
Move label color to front of array when removing worker (#230)
Browse files Browse the repository at this point in the history
Move label color to front of array when removing worker
  • Loading branch information
swrobel committed Sep 27, 2019
2 parents 466e694 + 91d1487 commit f0d9a13
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# v1.5.7
* Enable Manjaro Linux support
* Ensure same color is re-used for next started process, which is helpful to maintain consistency when using `reload` command (https://github.com/code-mancers/invoker/pull/230)
* Add `install` as an alias of `setup` command (https://github.com/code-mancers/invoker/pull/232)
* Change default process sleep duration to 0 (https://github.com/code-mancers/invoker/pull/231)
* Add `restart` as an alias of `reload` command (https://github.com/code-mancers/invoker/pull/229)
Expand Down
3 changes: 3 additions & 0 deletions lib/invoker/process_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ def remove_worker(command_label, trigger_event = true)
if worker
@open_pipes.delete(worker.pipe_end.fileno)
@workers.delete(command_label)
# Move label color to front of array so it's reused first
LABEL_COLORS.delete(worker.color)
LABEL_COLORS.unshift(worker.color)
end
if trigger_event
Invoker.commander.trigger(command_label, :worker_removed)
Expand Down

0 comments on commit f0d9a13

Please sign in to comment.