mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-16 09:24:00 +00:00
Fixing rate limiting.
This commit is contained in:
parent
c84a2d6b1e
commit
218653c52f
1 changed files with 3 additions and 5 deletions
|
@ -318,11 +318,9 @@ impl ChatServer {
|
||||||
};
|
};
|
||||||
|
|
||||||
rate_limit.last_checked = current;
|
rate_limit.last_checked = current;
|
||||||
if !check_only {
|
rate_limit.allowance += time_passed * (rate as f64 / per as f64);
|
||||||
rate_limit.allowance += time_passed * (rate as f64 / per as f64);
|
if !check_only && rate_limit.allowance > rate as f64 {
|
||||||
if rate_limit.allowance > rate as f64 {
|
rate_limit.allowance = rate as f64;
|
||||||
rate_limit.allowance = rate as f64;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if rate_limit.allowance < 1.0 {
|
if rate_limit.allowance < 1.0 {
|
||||||
|
|
Loading…
Reference in a new issue