move check for closure in walkChain
so that we don't do it too often and also cover warmup.
This commit is contained in:
parent
5cf1e09e81
commit
00d7772f57
@ -819,11 +819,6 @@ func (s *SplitStore) doCompact(curTs *types.TipSet) error {
|
|||||||
var count int64
|
var count int64
|
||||||
err = s.walkChain(curTs, boundaryEpoch, true,
|
err = s.walkChain(curTs, boundaryEpoch, true,
|
||||||
func(c cid.Cid) error {
|
func(c cid.Cid) error {
|
||||||
// marking takes a while, so check this with every opportunity
|
|
||||||
if err := s.checkClosing(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if isFilCommitment(c) {
|
if isFilCommitment(c) {
|
||||||
return errStopWalk
|
return errStopWalk
|
||||||
}
|
}
|
||||||
@ -1130,6 +1125,11 @@ func (s *SplitStore) walkChain(ts *types.TipSet, boundary abi.ChainEpoch, inclMs
|
|||||||
}
|
}
|
||||||
|
|
||||||
for len(toWalk) > 0 {
|
for len(toWalk) > 0 {
|
||||||
|
// walking can take a while, so check this with every opportunity
|
||||||
|
if err := s.checkClosing(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
walking := toWalk
|
walking := toWalk
|
||||||
toWalk = nil
|
toWalk = nil
|
||||||
for _, c := range walking {
|
for _, c := range walking {
|
||||||
|
Loading…
Reference in New Issue
Block a user