From f49dc5df3d406ca4a357ccb2ee6907cb81336a6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Wilczy=C5=84ski?= Date: Wed, 6 Nov 2024 15:33:15 +0100 Subject: [PATCH] pod-mon.sh and mist-cleanup.sh not to stop forever on a first crash --- middleware/shell.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/middleware/shell.go b/middleware/shell.go index ca5a0a0eb..5d5b917ec 100644 --- a/middleware/shell.go +++ b/middleware/shell.go @@ -7,6 +7,8 @@ import ( "os/exec" "sync" "time" + + "github.com/golang/glog" ) type Shell struct { @@ -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 } } }() @@ -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 }