check the closing state on each batch during the purge.
This commit is contained in:
parent
c6421f8a75
commit
fee50b13a2
@ -1402,6 +1402,11 @@ func (s *SplitStore) purge(cids []cid.Cid) error {
|
|||||||
func(cids []cid.Cid) error {
|
func(cids []cid.Cid) error {
|
||||||
deadCids := deadCids[:0]
|
deadCids := deadCids[:0]
|
||||||
|
|
||||||
|
if atomic.LoadInt32(&s.closing) == 1 {
|
||||||
|
log.Info("splitstore is closing; aborting purge")
|
||||||
|
return xerrors.Errorf("compaction aborted")
|
||||||
|
}
|
||||||
|
|
||||||
s.txnLk.Lock()
|
s.txnLk.Lock()
|
||||||
defer s.txnLk.Unlock()
|
defer s.txnLk.Unlock()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user