Skip to content

Commit

Permalink
pod-mon.sh and mist-cleanup.sh not to stop forever on a first crash
Browse files Browse the repository at this point in the history
  • Loading branch information
pwilczynskiclearcode committed Nov 6, 2024
1 parent 9264ab0 commit e60920a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions middleware/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"os/exec"
"sync"
"time"

"github.com/golang/glog"
)

type Shell struct {
Expand Down Expand Up @@ -39,8 +41,8 @@ func (s *Shell) RunBg() *time.Ticker {
for range ticker.C {
err := s.Run()
if err != nil {
log.Println("cmd: failed to start", s.Cmd)
break
glog.Errorf("cmd: failed to start %s", err)
continue
}
}
}()
Expand All @@ -61,6 +63,5 @@ func (s *Shell) Run() error {
return fmt.Errorf("cmd: failed to Run(): %s\n", err)
}
log.Printf("cmd: output: %s\n", out)

return err
return nil
}

0 comments on commit e60920a

Please sign in to comment.