@@ -144,7 +144,7 @@ func (p *path) stat(ls LocalStorage, newReserve ...statExistingSectorForReservat
144
144
}
145
145
146
146
if stat .Reserved < 0 {
147
- //log.Warnf("negative reserved storage: p.reserved=%d, reserved: %d", p.reserved, stat.Reserved)
147
+ // log.Warnf("negative reserved storage: p.reserved=%d, reserved: %d", p.reserved, stat.Reserved)
148
148
var jsonReservations []map [string ]interface {}
149
149
for id , res := range p .reservations {
150
150
jsonReservations = append (jsonReservations , map [string ]interface {}{
@@ -182,8 +182,8 @@ func (p *path) stat(ls LocalStorage, newReserve ...statExistingSectorForReservat
182
182
}
183
183
}
184
184
185
- if time .Now (). Sub ( start ) > 5 * time .Second {
186
- log .Warnw ("slow storage stat" , "took" , time . Now (). Sub ( start ) , "reservations" , len (p .reservations ))
185
+ if took := time .Since ( start ); took > 5 * time .Second {
186
+ log .Warnw ("slow storage stat" , "took" , took , "reservations" , len (p .reservations ))
187
187
}
188
188
189
189
return stat , newReserveOnDisk , err
@@ -463,7 +463,8 @@ func (st *Local) reportStorage(ctx context.Context) {
463
463
}
464
464
465
465
func (st * Local ) Reserve (ctx context.Context , sid storiface.SectorRef , ft storiface.SectorFileType ,
466
- storageIDs storiface.SectorPaths , overheadTab map [storiface.SectorFileType ]int , minFreePercentage float64 ) (func (), error ) {
466
+ storageIDs storiface.SectorPaths , overheadTab map [storiface.SectorFileType ]int , minFreePercentage float64 ,
467
+ ) (func (), error ) {
467
468
ssize , err := sid .ProofType .SectorSize ()
468
469
if err != nil {
469
470
return nil , err
@@ -661,7 +662,6 @@ func (st *Local) AcquireSector(ctx context.Context, sid storiface.SectorRef, exi
661
662
}
662
663
663
664
alloc , err := allocPathOk (si .CanSeal , si .CanStore , si .AllowTypes , si .DenyTypes , si .AllowMiners , si .DenyMiners , fileType , sid .ID .Miner )
664
-
665
665
if err != nil {
666
666
log .Debug (err )
667
667
continue
@@ -950,7 +950,7 @@ func (st *Local) GenerateSingleVanillaProof(ctx context.Context, minerID abi.Act
950
950
case r := <- resCh :
951
951
return r .Unwrap ()
952
952
case <- ctx .Done ():
953
- log .Errorw ("failed to generate valilla PoSt proof before context cancellation" , "err" , ctx .Err (), "duration" , time .Now (). Sub (start ), "cache-id" , cacheID , "sealed-id" , sealedID , "cache" , cache , "sealed" , sealed )
953
+ log .Errorw ("failed to generate valilla PoSt proof before context cancellation" , "err" , ctx .Err (), "duration" , time .Since (start ), "cache-id" , cacheID , "sealed-id" , sealedID , "cache" , cache , "sealed" , sealed )
954
954
955
955
// this will leave the GenerateSingleVanillaProof goroutine hanging, but that's still less bad than failing PoSt
956
956
return nil , xerrors .Errorf ("failed to generate vanilla proof before context cancellation: %w" , ctx .Err ())
0 commit comments