Made a stylistic change to the new message throttling code.
This commit is contained in:
parent
70ff2ec992
commit
68666aef09
1 changed files with 3 additions and 6 deletions
|
@ -152,12 +152,9 @@ where
|
||||||
Err(error::ErrorKind::PingTimeout.into())
|
Err(error::ErrorKind::PingTimeout.into())
|
||||||
} else {
|
} else {
|
||||||
// Check if the oldest message in the rolling window is discounted.
|
// Check if the oldest message in the rolling window is discounted.
|
||||||
match self.rolling_burst_window_front()? {
|
if let Async::Ready(()) = self.rolling_burst_window_front()? {
|
||||||
Async::NotReady => (),
|
self.current_burst_messages -= 1;
|
||||||
Async::Ready(()) => {
|
self.rolling_burst_window.pop_front();
|
||||||
self.current_burst_messages -= 1;
|
|
||||||
self.rolling_burst_window.pop_front();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Throttling if too many messages have been sent recently.
|
// Throttling if too many messages have been sent recently.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue