Skip to content

Commit

Permalink
Clear errors (#78)
Browse files Browse the repository at this point in the history
* Clear state errors when all good.

* Also clear when not pinging.
  • Loading branch information
tongson authored Aug 22, 2024
1 parent 52b19ee commit b0c65ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,11 @@ func run(exec *ExecContext) error {
log.Warningf("Service %q, error running systemctl: %s", s.Service, err)
s.SetState(StateBroken, fmt.Sprintf("error running systemctl %q: %s", s.Upstream, err))
// no continue; maybe git pull will make this work later
} else {
s.SetState(StateOK, "")
}
} else {
s.SetState(StateOK, "")
}

workerWG.Add(1)
Expand Down
1 change: 1 addition & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ func (s *Service) trackUpstream(ctx context.Context, duration time.Duration) {
s.SetState(StateBroken, fmt.Sprintf("error running systemctl %q: %s", s.Upstream, err))
continue
}
s.SetState(StateOK, "")
}
}

Expand Down

0 comments on commit b0c65ec

Please sign in to comment.