compact hotstore if it provides the method
This commit is contained in:
parent
01ce9b5c44
commit
353bb1881f
@ -798,6 +798,18 @@ func (s *SplitStore) purgeTracking(cids []cid.Cid) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *SplitStore) gcHotstore() {
|
func (s *SplitStore) gcHotstore() {
|
||||||
|
if compact, ok := s.hot.(interface{ Compact() error }); ok {
|
||||||
|
log.Infof("compacting hotstore")
|
||||||
|
startCompact := time.Now()
|
||||||
|
err := compact.Compact()
|
||||||
|
if err != nil {
|
||||||
|
log.Warnf("error compacting hotstore: %s", err)
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
log.Infow("hotstore compaction done", "took", time.Since(startCompact))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if gc, ok := s.hot.(interface{ CollectGarbage() error }); ok {
|
if gc, ok := s.hot.(interface{ CollectGarbage() error }); ok {
|
||||||
log.Infof("garbage collecting hotstore")
|
log.Infof("garbage collecting hotstore")
|
||||||
startGC := time.Now()
|
startGC := time.Now()
|
||||||
|
Loading…
Reference in New Issue
Block a user