Skip to content

Commit

Permalink
fix: start when id exist throw error
Browse files Browse the repository at this point in the history
  • Loading branch information
zaigie committed Mar 31, 2024
1 parent 6fe05b6 commit 656449d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions process/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ func (pm *ProcessManager) Start(id string, name string, args []string, hook Proc
}
pm.mu.Unlock()

if process, _ := pm.Get(id); process != nil {
return "", ErrorProcessRunning
}

cmd := exec.Command(name, args...)

stdoutPipe, err := cmd.StdoutPipe()
Expand Down

0 comments on commit 656449d

Please sign in to comment.