mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-02-05 14:33:29 +00:00
fix: missing rate limit setting for legacy store protocol (#2631)
This commit is contained in:
parent
665d9e3a06
commit
c1394bc470
@ -11,7 +11,8 @@ export tokenbucket
|
||||
|
||||
type RateLimitSetting* = tuple[volume: int, period: Duration]
|
||||
|
||||
let DefaultGlobalNonRelayRateLimit*: RateLimitSetting = (60, 1.minutes)
|
||||
# Set the default to switch off rate limiting for now
|
||||
let DefaultGlobalNonRelayRateLimit*: RateLimitSetting = (0, 0.minutes)
|
||||
|
||||
proc newTokenBucket*(setting: Option[RateLimitSetting]): Option[TokenBucket] =
|
||||
if setting.isNone:
|
||||
|
||||
@ -244,15 +244,15 @@ proc setupProtocols(
|
||||
return err("failed to mount waku archive protocol: " & mountArcRes.error)
|
||||
|
||||
# Store setup
|
||||
let rateLimitSetting: RateLimitSetting =
|
||||
(conf.requestRateLimit, chronos.seconds(conf.requestRatePeriod))
|
||||
try:
|
||||
let rateLimitSetting: RateLimitSetting =
|
||||
(conf.requestRateLimit, chronos.seconds(conf.requestRatePeriod))
|
||||
await mountStore(node, rateLimitSetting)
|
||||
except CatchableError:
|
||||
return err("failed to mount waku store protocol: " & getCurrentExceptionMsg())
|
||||
|
||||
try:
|
||||
await mountLegacyStore(node)
|
||||
await mountLegacyStore(node, rateLimitSetting)
|
||||
except CatchableError:
|
||||
return
|
||||
err("failed to mount waku legacy store protocol: " & getCurrentExceptionMsg())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user