Merge pull request #11177 from filecoin-project/sbansal/unseal-background

fix: sealing: Run unsealing in the background for better ux
This commit is contained in:
Andrew Jackson (Ajax) 2023-08-21 11:37:59 -05:00 committed by GitHub
commit cb7231cb8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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