Skip to content

Commit

Permalink
Fix off by 1_000_000
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsnaps committed May 14, 2024
1 parent 9a30916 commit d364a01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion limitador/src/storage/distributed/cr_counter_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl<A: Ord> CrCounterValue<A> {
pub fn inc_at(&self, increment: u64, time_window: Duration, when: SystemTime) {
if self
.expiry
.update_if_expired(time_window.as_micros() as u64, when)
.update_if_expired(time_window.as_secs(), when)
{
self.value.store(increment, Ordering::SeqCst);
} else {
Expand Down
2 changes: 1 addition & 1 deletion limitador/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ macro_rules! test_with_all_storage_impls {
#[tokio::test]
async fn [<$function _distributed_storage>]() {
let rate_limiter =
RateLimiter::new_with_storage(Box::new(CrInMemoryStorage::new("test_node".to_owned(), 10_000)));
RateLimiter::new_with_storage(Box::new(CrInMemoryStorage::new("test_node".to_owned(), 10_000, "127.0.0.1:19876".to_owned(), "127.0.0.255:19876".to_owned())));
$function(&mut TestsLimiter::new_from_blocking_impl(rate_limiter)).await;
}

Expand Down

0 comments on commit d364a01

Please sign in to comment.