Merge pull request #3140 from filecoin-project/asr/restart-timer
restart WaitDeals timers if miner restarts
This commit is contained in:
commit
b4d9b6efaf
15
extern/storage-sealing/fsm.go
vendored
15
extern/storage-sealing/fsm.go
vendored
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user