mirror of
https://github.com/falcosecurity/falco.git
synced 2025-08-30 12:30:56 +00:00
Fix token bucket rate
We were dividing the tokens gained by the rate instead of multiplying.
This commit is contained in:
parent
76876bc3ae
commit
1ad91c05f5
@ -48,7 +48,7 @@ bool token_bucket::claim(uint64_t now)
|
||||
now = sinsp_utils::get_current_time_ns();
|
||||
}
|
||||
|
||||
double tokens_gained = (now - m_last_seen) / (m_rate * 1000000000);
|
||||
double tokens_gained = m_rate * ((now - m_last_seen) / (1000000000.0));
|
||||
m_last_seen = now;
|
||||
|
||||
m_tokens += tokens_gained;
|
||||
|
Loading…
Reference in New Issue
Block a user