Skip to content

Commit f6671c3

Browse files
committed
feat: log when checkpoint fails
1 parent 94b446c commit f6671c3

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

pkg/manager/manager.go

+14-2
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,13 @@ func (m *Manager) Run() {
220220
}).Debugf("Calling RunSync() to w %s", w.GetConfig()["name"])
221221
go w.RunSync()
222222
}
223-
m.checkpoint()
223+
err := m.checkpoint()
224+
if err != nil {
225+
m.logger.WithFields(logrus.Fields{
226+
"event": "checkpoint_failed",
227+
"error": err,
228+
}).Error("Failed to checkpoint")
229+
}
224230
for {
225231
// wait until config.Interval seconds has elapsed
226232
select {
@@ -264,7 +270,13 @@ func (m *Manager) Run() {
264270
// Here we do not checkpoint very concisely (e.g. every time after a successful sync).
265271
// We just want to minimize re-sync after restarting lug.
266272
if shouldCheckpoint {
267-
m.checkpoint()
273+
err := m.checkpoint()
274+
if err != nil {
275+
m.logger.WithFields(logrus.Fields{
276+
"event": "checkpoint_failed",
277+
"error": err,
278+
}).Error("Failed to checkpoint")
279+
}
268280
}
269281
}
270282
case sig, ok := <-m.controlChan:

0 commit comments

Comments
 (0)