fix goroutine call for commands with no handlers
This commit is contained in:
parent
2a59a80b11
commit
2b190eccb7
1 changed files with 31 additions and 27 deletions
|
@ -119,7 +119,10 @@ func (cmd *LinuxCommand) Run() error {
|
|||
}
|
||||
}
|
||||
|
||||
cmd.wg.Add(3)
|
||||
cmd.wg.Add(1)
|
||||
|
||||
if len(cmd.handlers) != 0 {
|
||||
cmd.wg.Add(2)
|
||||
|
||||
go func() {
|
||||
defer cmd.wg.Done()
|
||||
|
@ -153,6 +156,7 @@ func (cmd *LinuxCommand) Run() error {
|
|||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
go func() {
|
||||
defer cmd.wg.Done()
|
||||
|
|
Loading…
Reference in a new issue