storage: Better errors when starting sectorStateLoop

This commit is contained in:
Łukasz Magiera 2019-12-09 16:11:54 +01:00
parent d18179d347
commit e3d1f5b362
2 changed files with 3 additions and 3 deletions

View File

@ -105,7 +105,7 @@ func (m *Miner) Run(ctx context.Context) error {
go fps.run(ctx)
if err := m.sectorStateLoop(ctx); err != nil {
log.Error(err)
log.Errorf("%+v", err)
return xerrors.Errorf("failed to startup sector state loop: %w", err)
}

View File

@ -65,7 +65,7 @@ func (m *Miner) UpdateSectorState(ctx context.Context, sector uint64, snonce uin
func (m *Miner) sectorStateLoop(ctx context.Context) error {
trackedSectors, err := m.ListSectors()
if err != nil {
return err
return xerrors.Errorf("loading sector list: %w", err)
}
go func() {
@ -100,7 +100,7 @@ func (m *Miner) sectorStateLoop(ctx context.Context) error {
ps, err := m.api.StateMinerProvingSet(ctx, m.maddr, curTs)
if err != nil {
return err
return xerrors.Errorf("getting miner proving set: %w", err)
}
for _, ocs := range ps {
if _, ok := trackedByID[ocs.SectorID]; ok {