sectorbuilder: open FD later in AddPiece
This commit is contained in:
parent
65c669b0f2
commit
7690c2f3b7
@ -170,14 +170,14 @@ func (sb *SectorBuilder) AcquireSectorId() (uint64, error) {
|
||||
}
|
||||
|
||||
func (sb *SectorBuilder) AddPiece(pieceSize uint64, sectorId uint64, file io.Reader, existingPieceSizes []uint64) (PublicPieceInfo, error) {
|
||||
ret := sb.RateLimit()
|
||||
defer ret()
|
||||
|
||||
f, werr, err := toReadableFile(file, int64(pieceSize))
|
||||
if err != nil {
|
||||
return PublicPieceInfo{}, err
|
||||
}
|
||||
|
||||
ret := sb.RateLimit()
|
||||
defer ret()
|
||||
|
||||
stagedFile, err := sb.stagedSectorFile(sectorId)
|
||||
if err != nil {
|
||||
return PublicPieceInfo{}, err
|
||||
|
Loading…
Reference in New Issue
Block a user