From 578b5691bc12c339387983d412b06c617338d3ed Mon Sep 17 00:00:00 2001 From: vyzo Date: Tue, 1 Feb 2022 10:59:08 +0200 Subject: [PATCH] check for closing after the sync wait --- blockstore/splitstore/splitstore_compact.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/blockstore/splitstore/splitstore_compact.go b/blockstore/splitstore/splitstore_compact.go index 82cf8ada9..ca941cf90 100644 --- a/blockstore/splitstore/splitstore_compact.go +++ b/blockstore/splitstore/splitstore_compact.go @@ -663,10 +663,14 @@ func (s *SplitStore) doCompact(curTs *types.TipSet) error { return err } - // wait for the head to catch up so that all messages are protected + // wait for the head to catch up so that all messages in the current head are protected log.Infof("waiting %s for sync", SyncWaitTime) time.Sleep(SyncWaitTime) + if err := s.checkClosing(); err != nil { + return err + } + checkpoint, err := NewCheckpoint(s.checkpointPath()) if err != nil { return xerrors.Errorf("error creating checkpoint: %w", err)