Skip to content

Commit

Permalink
fix restart process race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
F1bonacc1 committed Jul 21, 2023
1 parent e81bc97 commit ed79278
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/app/project_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,10 @@ func (p *ProjectRunner) StopProcesses(names []string) ([]string, error) {
func (p *ProjectRunner) RestartProcess(name string) error {
proc := p.getRunningProcess(name)
if proc != nil {
_ = proc.shutDown()
if proc.isRestartable() {
return nil
err := proc.shutDownNoRestart()
if err != nil {
log.Err(err).Msgf("failed to stop process %s", name)
return err
}
time.Sleep(proc.getBackoff())
}
Expand Down

0 comments on commit ed79278

Please sign in to comment.