mirror of
https://gitlab.com/famedly/conduit.git
synced 2025-06-27 16:35:59 +00:00
fix nano gap
This commit is contained in:
parent
024f910bf9
commit
e20fcb029a
1 changed files with 2 additions and 2 deletions
|
@ -78,7 +78,7 @@ impl Service {
|
|||
|
||||
tracing::info!(?limit);
|
||||
|
||||
let increment = 1_000_000_000u64 / limit.timeframe.nano_gap() * limit.weight.get();
|
||||
let increment = limit.timeframe.nano_gap() * limit.weight.get();
|
||||
tracing::info!(?increment);
|
||||
|
||||
let mut prev_expectation = self
|
||||
|
@ -87,7 +87,7 @@ impl Service {
|
|||
.as_deref()
|
||||
.map(|n| n.load(Ordering::Acquire))
|
||||
.unwrap_or_else(|| arrival + increment);
|
||||
let weight = (increment * limit.burst_capacity.get()).max(1);
|
||||
let weight = increment * limit.burst_capacity.get();
|
||||
|
||||
tracing::info!(?prev_expectation);
|
||||
tracing::info!(?weight);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue