Skip to content

Commit

Permalink
Merge pull request #11177 from filecoin-project/sbansal/unseal-backgr…
Browse files Browse the repository at this point in the history
…ound

fix: sealing: Run unsealing in the background for better ux
  • Loading branch information
snadrus authored Aug 21, 2023
2 parents 1fe7493 + 9e69576 commit cb7231c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion node/impl/storminer.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,16 @@ func (sm *StorageMinerAPI) SectorUnseal(ctx context.Context, sectorNum abi.Secto
ProofType: status.SealProof,
}

return sm.StorageMgr.SectorsUnsealPiece(ctx, sector, storiface.UnpaddedByteIndex(0), abi.UnpaddedPieceSize(0), status.Ticket.Value, status.CommD)
bgCtx := context.Background()

go func() {
err := sm.StorageMgr.SectorsUnsealPiece(bgCtx, sector, storiface.UnpaddedByteIndex(0), abi.UnpaddedPieceSize(0), status.Ticket.Value, status.CommD)
if err != nil {
log.Errorf("unseal for sector %d failed: %+v", sectorNum, err)
}
}()

return nil
}

// List all staged sectors
Expand Down

0 comments on commit cb7231c

Please sign in to comment.