From 64817f463c1173413bff0b2b7307d35316c06341 Mon Sep 17 00:00:00 2001 From: ModulatingForce <116608425+modulatingforce@users.noreply.github.com> Date: Wed, 20 Dec 2023 18:59:08 -0500 Subject: [PATCH] comment cleanup --- src/core/ratelimiter.rs | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/src/core/ratelimiter.rs b/src/core/ratelimiter.rs index e8f73a7..c2526c1 100644 --- a/src/core/ratelimiter.rs +++ b/src/core/ratelimiter.rs @@ -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; }