Run unsealing in the background for better ux

This commit is contained in:
Shrenuj Bansal 2023-08-16 17:20:39 -04:00
parent 33182967eb
commit 38350b8d8a

View File

@ -278,7 +278,13 @@ 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() {
sm.StorageMgr.SectorsUnsealPiece(bgCtx, sector, storiface.UnpaddedByteIndex(0), abi.UnpaddedPieceSize(0), status.Ticket.Value, status.CommD)
}()
return nil
}
// List all staged sectors