Skip to content

Commit 1e2b0fb

Browse files
committed
anchor and flush fix
1 parent 4a02e08 commit 1e2b0fb

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

monitor.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,9 @@ func (m *Monitor) Stop() error {
346346
// TODO dirty statics deal with
347347
if m.engine != nil {
348348
log.Info("Golang-kv engine close", "engine", m.engine.Name())
349-
return m.engine.Close()
349+
if err := m.engine.Close(); err != nil {
350+
return err
351+
}
350352
}
351353

352354
if err := m.fs.Close(); err != nil {
@@ -490,14 +492,11 @@ func (m *Monitor) syncLatestBlock() {
490492
log.Info("Monitor status", "blocks", progress, "current", m.CurrentNumber(), "latest", m.lastNumber.Load(), "txs", m.fs.Txs(), "ckp", m.fs.CheckPoint(), "last", m.fs.LastListenBlockNumber(), "progress", progress, "root", m.fs.Root())
491493
counter = 0
492494
}
493-
494495
// Always flush at the end of a timer cycle
495-
m.fs.Flush()
496+
m.fs.Anchor(m.lastNumber.Load())
497+
//m.fs.Flush()
496498

497499
case <-m.exitCh:
498-
log.Info("Block syncer stopped")
499-
// Flush one last time before returning
500-
m.fs.Flush()
501500
return
502501
}
503502
}

0 commit comments

Comments
 (0)