From f2d8113f70e8a009de13d812df9ba5b3c41f23fd Mon Sep 17 00:00:00 2001
From: pablo
Date: Mon, 1 Sep 2025 05:55:44 +0300
Subject: [PATCH] fix: added todos
---
ratelimit/store.nim | 2 ++
ratelimit/token_bucket.nim | 2 ++
2 files changed, 4 insertions(+)
diff --git a/ratelimit/store.nim b/ratelimit/store.nim
index 262bd41..42fd152 100644
--- a/ratelimit/store.nim
+++ b/ratelimit/store.nim
@@ -22,6 +22,8 @@ type
const BUCKET_STATE_KEY = "rate_limit_bucket_state"
+## TODO find a way to make these procs async
+
proc new*[T](M: type[RateLimitStore[T]], db: DbConn): Future[M] {.async} =
result = M(db: db, criticalLength: 0, normalLength: 0, nextBatchId: 1)
diff --git a/ratelimit/token_bucket.nim b/ratelimit/token_bucket.nim
index e2c606d..13e40a1 100644
--- a/ratelimit/token_bucket.nim
+++ b/ratelimit/token_bucket.nim
@@ -4,6 +4,8 @@ import chronos, std/math, std/options
const BUDGET_COMPENSATION_LIMIT_PERCENT = 0.25
+## TODO! This will be remoded and replaced by https://github.com/status-im/nim-chronos/pull/582
+
## This is an extract from chronos/rate_limit.nim due to the found bug in the original implementation.
## Unfortunately that bug cannot be solved without harm the original features of TokenBucket class.
## So, this current shortcut is used to enable move ahead with nwaku rate limiter implementation.