Skip to content

Commit

Permalink
remove need wait
Browse files Browse the repository at this point in the history
Signed-off-by: nolouch <[email protected]>
  • Loading branch information
nolouch committed May 14, 2024
1 parent a674e66 commit 21bc172
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion client/resource_group/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,14 @@ func (gc *groupCostController) onResponse(
case rmpb.GroupMode_RUMode:
for typ, counter := range gc.run.requestUnitTokens {
if v := getRUValueFromConsumption(delta, typ); v > 0 {
counter.limiter.RemoveTokens(time.Now(), v)
// counter.limiter.RemoveTokens(time.Now(), v)
now := time.Now()
res := counter.limiter.Reserve(context.Background(), gc.mainCfg.LTBMaxWaitDuration, now, v)
if d, err := WaitReservations(context.Background(), now, []*Reservation{res}); err != nil {
return nil, err
} else {
gc.successfulRequestDuration.Observe(d.Seconds())
}
}
}
}
Expand Down

0 comments on commit 21bc172

Please sign in to comment.