@@ -356,7 +356,7 @@ func (n *nodeBalance) estimatePriority(capacity uint64, addBalance int64, future
356
356
b = n .reducedBalance (b , now , future , capacity , avgReqCost )
357
357
}
358
358
if bias > 0 {
359
- b = n .reducedBalance (b , now + mclock . AbsTime (future ), bias , capacity , 0 )
359
+ b = n .reducedBalance (b , now . Add (future ), bias , capacity , 0 )
360
360
}
361
361
pri := n .balanceToPriority (now , b , capacity )
362
362
// Ensure that biased estimates are always lower than actual priorities, even if
@@ -512,15 +512,15 @@ func (n *nodeBalance) scheduleCheck(now mclock.AbsTime) {
512
512
n .updateAfter (0 )
513
513
return
514
514
}
515
- if n .nextUpdate == 0 || n .nextUpdate > now + mclock . AbsTime (d ) {
515
+ if n .nextUpdate == 0 || n .nextUpdate > now . Add (d ) {
516
516
if d > time .Second {
517
517
// Note: if the scheduled update is not in the very near future then we
518
518
// schedule the update a bit earlier. This way we do need to update a few
519
519
// extra times but don't need to reschedule every time a processed request
520
520
// brings the expected firing time a little bit closer.
521
521
d = ((d - time .Second ) * 7 / 8 ) + time .Second
522
522
}
523
- n .nextUpdate = now + mclock . AbsTime (d )
523
+ n .nextUpdate = now . Add (d )
524
524
n .updateAfter (d )
525
525
}
526
526
} else {
@@ -629,7 +629,7 @@ func (n *nodeBalance) reducedBalance(b balance, start mclock.AbsTime, dt time.Du
629
629
// since the costs are applied continuously during the dt time period we calculate
630
630
// the expiration offset at the middle of the period
631
631
var (
632
- at = start + mclock . AbsTime (dt / 2 )
632
+ at = start . Add (dt / 2 )
633
633
dtf = float64 (dt )
634
634
)
635
635
if ! b .pos .IsZero () {
0 commit comments