comment cleanup
This commit is contained in:
parent
606663731c
commit
64817f463c
1 changed files with 0 additions and 38 deletions
|
@ -25,40 +25,6 @@ impl RateLimiter {
|
|||
}
|
||||
}
|
||||
|
||||
// pub fn check_limiter(&mut self) -> LimiterResp {
|
||||
|
||||
// if self.timer.elapsed().as_secs() >= TIME_THRESHOLD_S {
|
||||
// // # [x] elapsed >= TIME_THRESHOLD_S
|
||||
// self.timer = Instant::now();
|
||||
// self.msgcounter = 0;
|
||||
// LimiterResp::Allow
|
||||
// } else if self.msgcounter < MSG_THRESHOLD {
|
||||
// // # [x] elapsed < TIME_THRESHOLD_S && msgcounter < MSG_THRESHOLD
|
||||
// LimiterResp::Allow
|
||||
// // } else if self.msgcounter >= MSG_THRESHOLD {
|
||||
// } else {
|
||||
// // # [x] elapsed < TIME_THRESHOLD_S && msgcounter >= MSG_THRESHOLD
|
||||
// LimiterResp::Skip
|
||||
// }
|
||||
// }
|
||||
|
||||
// pub fn check_limiter(&self) -> LimiterResp {
|
||||
|
||||
// if self.timer.elapsed().as_secs() >= TIME_THRESHOLD_S {
|
||||
// // # [x] elapsed >= TIME_THRESHOLD_S
|
||||
// self.timer = Instant::now();
|
||||
// self.msgcounter = 0;
|
||||
// LimiterResp::Allow
|
||||
// } else if self.msgcounter < MSG_THRESHOLD {
|
||||
// // # [x] elapsed < TIME_THRESHOLD_S && msgcounter < MSG_THRESHOLD
|
||||
// LimiterResp::Allow
|
||||
// // } else if self.msgcounter >= MSG_THRESHOLD {
|
||||
// } else {
|
||||
// // # [x] elapsed < TIME_THRESHOLD_S && msgcounter >= MSG_THRESHOLD
|
||||
// LimiterResp::Skip
|
||||
// }
|
||||
// }
|
||||
|
||||
pub fn check_limiter(&mut self) -> LimiterResp {
|
||||
|
||||
if self.timer.elapsed().as_secs() >= TIME_THRESHOLD_S {
|
||||
|
@ -76,10 +42,6 @@ pub fn check_limiter(&mut self) -> LimiterResp {
|
|||
}
|
||||
}
|
||||
|
||||
// pub fn increment_counter(&mut self) -> () {
|
||||
// self.msgcounter += 1;
|
||||
// }
|
||||
|
||||
pub fn increment_counter(&mut self) -> () {
|
||||
self.msgcounter += 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue