rename GC to CollectGarbage, ignore badger.ErrNoRewrite

This commit is contained in:
vyzo
2021-03-08 19:42:38 +02:00
parent 52de95d344
commit 3d1b855f20
2 changed files with 15 additions and 9 deletions
+6 -6
View File
@@ -710,14 +710,14 @@ func (s *SplitStore) compactSimple(curTs *types.TipSet) error {
return xerrors.Errorf("error syncing tracker: %w", err)
}
if gc, ok := s.hot.(interface{ GC() error }); ok {
if gc, ok := s.hot.(interface{ CollectGarbage() error }); ok {
log.Infof("garbage collecting hotstore")
startGC := time.Now()
err = gc.GC()
err = gc.CollectGarbage()
if err != nil {
log.Warnf("error garbage collecting hotstore: %s", err)
} else {
log.Infow("garbage collecting done", "took", time.Since(startGC))
log.Infow("garbage collection done", "took", time.Since(startGC))
}
}
@@ -1016,14 +1016,14 @@ func (s *SplitStore) compactFull(curTs *types.TipSet) error {
return xerrors.Errorf("error syncing tracker: %w", err)
}
if gc, ok := s.hot.(interface{ GC() error }); ok {
if gc, ok := s.hot.(interface{ CollectGarbage() error }); ok {
log.Infof("garbage collecting hotstore")
startGC := time.Now()
err = gc.GC()
err = gc.CollectGarbage()
if err != nil {
log.Warnf("error garbage collecting hotstore: %s", err)
} else {
log.Infow("garbage collecting done", "took", time.Since(startGC))
log.Infow("garbage collection done", "took", time.Since(startGC))
}
}