sectorstorage: Variable scopes are hard
This commit is contained in:
parent
6ddea62d09
commit
54fdd6ba5a
35
extern/sector-storage/manager.go
vendored
35
extern/sector-storage/manager.go
vendored
@ -370,10 +370,11 @@ func (m *Manager) SealPreCommit1(ctx context.Context, sector abi.SectorID, ticke
|
|||||||
}
|
}
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
|
var waitErr error
|
||||||
waitRes := func() {
|
waitRes := func() {
|
||||||
p, werr := m.waitWork(ctx, wk)
|
p, werr := m.waitWork(ctx, wk)
|
||||||
if werr != nil {
|
if werr != nil {
|
||||||
err = werr
|
waitErr = werr
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
out = p.(storage.PreCommit1Out)
|
out = p.(storage.PreCommit1Out)
|
||||||
@ -401,8 +402,11 @@ func (m *Manager) SealPreCommit1(ctx context.Context, sector abi.SectorID, ticke
|
|||||||
waitRes()
|
waitRes()
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
return out, err
|
return out, waitErr
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Manager) SealPreCommit2(ctx context.Context, sector abi.SectorID, phase1Out storage.PreCommit1Out) (out storage.SectorCids, err error) {
|
func (m *Manager) SealPreCommit2(ctx context.Context, sector abi.SectorID, phase1Out storage.PreCommit1Out) (out storage.SectorCids, err error) {
|
||||||
@ -415,10 +419,11 @@ func (m *Manager) SealPreCommit2(ctx context.Context, sector abi.SectorID, phase
|
|||||||
}
|
}
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
|
var waitErr error
|
||||||
waitRes := func() {
|
waitRes := func() {
|
||||||
p, werr := m.waitWork(ctx, wk)
|
p, werr := m.waitWork(ctx, wk)
|
||||||
if werr != nil {
|
if werr != nil {
|
||||||
err = werr
|
waitErr = werr
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
out = p.(storage.SectorCids)
|
out = p.(storage.SectorCids)
|
||||||
@ -444,7 +449,11 @@ func (m *Manager) SealPreCommit2(ctx context.Context, sector abi.SectorID, phase
|
|||||||
waitRes()
|
waitRes()
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
return out, err
|
if err != nil {
|
||||||
|
return storage.SectorCids{}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return out, waitErr
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Manager) SealCommit1(ctx context.Context, sector abi.SectorID, ticket abi.SealRandomness, seed abi.InteractiveSealRandomness, pieces []abi.PieceInfo, cids storage.SectorCids) (out storage.Commit1Out, err error) {
|
func (m *Manager) SealCommit1(ctx context.Context, sector abi.SectorID, ticket abi.SealRandomness, seed abi.InteractiveSealRandomness, pieces []abi.PieceInfo, cids storage.SectorCids) (out storage.Commit1Out, err error) {
|
||||||
@ -457,10 +466,11 @@ func (m *Manager) SealCommit1(ctx context.Context, sector abi.SectorID, ticket a
|
|||||||
}
|
}
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
|
var waitErr error
|
||||||
waitRes := func() {
|
waitRes := func() {
|
||||||
p, werr := m.waitWork(ctx, wk)
|
p, werr := m.waitWork(ctx, wk)
|
||||||
if werr != nil {
|
if werr != nil {
|
||||||
err = werr
|
waitErr = werr
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
out = p.(storage.Commit1Out)
|
out = p.(storage.Commit1Out)
|
||||||
@ -489,7 +499,11 @@ func (m *Manager) SealCommit1(ctx context.Context, sector abi.SectorID, ticket a
|
|||||||
waitRes()
|
waitRes()
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
return out, err
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return out, waitErr
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Manager) SealCommit2(ctx context.Context, sector abi.SectorID, phase1Out storage.Commit1Out) (out storage.Proof, err error) {
|
func (m *Manager) SealCommit2(ctx context.Context, sector abi.SectorID, phase1Out storage.Commit1Out) (out storage.Proof, err error) {
|
||||||
@ -499,10 +513,11 @@ func (m *Manager) SealCommit2(ctx context.Context, sector abi.SectorID, phase1Ou
|
|||||||
}
|
}
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
|
var waitErr error
|
||||||
waitRes := func() {
|
waitRes := func() {
|
||||||
p, werr := m.waitWork(ctx, wk)
|
p, werr := m.waitWork(ctx, wk)
|
||||||
if werr != nil {
|
if werr != nil {
|
||||||
err = werr
|
waitErr = werr
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
out = p.(storage.Proof)
|
out = p.(storage.Proof)
|
||||||
@ -525,7 +540,11 @@ func (m *Manager) SealCommit2(ctx context.Context, sector abi.SectorID, phase1Ou
|
|||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
||||||
return out, err
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return out, waitErr
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Manager) FinalizeSector(ctx context.Context, sector abi.SectorID, keepUnsealed []storage.Range) error {
|
func (m *Manager) FinalizeSector(ctx context.Context, sector abi.SectorID, keepUnsealed []storage.Range) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user