Merge pull request #3140 from filecoin-project/asr/restart-timer

restart WaitDeals timers if miner restarts
This commit is contained in:
Łukasz Magiera 2020-08-18 13:54:55 +02:00 committed by GitHub
commit b4d9b6efaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -328,10 +328,25 @@ func (m *Sealing) restartSectors(ctx context.Context) error {
log.Errorf("loading sector list: %+v", err)
}
sd, err := m.getSealDelay()
if err != nil {
return xerrors.Errorf("getting the sealing delay: %w", err)
}
for _, sector := range trackedSectors {
if err := m.sectors.Send(uint64(sector.SectorNumber), SectorRestart{}); err != nil {
log.Errorf("restarting sector %d: %+v", sector.SectorNumber, err)
}
if sector.State == WaitDeals {
if sd > 0 {
timer := time.NewTimer(sd)
go func() {
<-timer.C
m.StartPacking(sector.SectorNumber)
}()
}
}
}
// TODO: Grab on-chain sector set and diff with trackedSectors