Skip to content

Commit

Permalink
feat: log when checkpoint fails
Browse files Browse the repository at this point in the history
  • Loading branch information
PhotonQuantum committed Jun 4, 2024
1 parent 94b446c commit f6671c3
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions pkg/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,13 @@ func (m *Manager) Run() {
}).Debugf("Calling RunSync() to w %s", w.GetConfig()["name"])
go w.RunSync()
}
m.checkpoint()
err := m.checkpoint()
if err != nil {
m.logger.WithFields(logrus.Fields{
"event": "checkpoint_failed",
"error": err,
}).Error("Failed to checkpoint")
}
for {
// wait until config.Interval seconds has elapsed
select {
Expand Down Expand Up @@ -264,7 +270,13 @@ func (m *Manager) Run() {
// Here we do not checkpoint very concisely (e.g. every time after a successful sync).
// We just want to minimize re-sync after restarting lug.
if shouldCheckpoint {
m.checkpoint()
err := m.checkpoint()
if err != nil {
m.logger.WithFields(logrus.Fields{
"event": "checkpoint_failed",
"error": err,
}).Error("Failed to checkpoint")
}
}
}
case sig, ok := <-m.controlChan:
Expand Down

0 comments on commit f6671c3

Please sign in to comment.