Open stephen-lazarionok opened 6 months ago
Is there any plan to fix this?
what i did is just add an exception that return 0 for pexpire if redis is unavailable in depends:RateLimiter class:
async def _check(self, key):
redis = FastAPILimiter.redis
try:
pexpire = await redis.evalsha(
FastAPILimiter.lua_sha, 1, key, str(self.times), str(self.milliseconds)
)
except:
logger.exception("Redis is unavaible - ratelimiter disabled")
return 0
return pexpire
prolly not the best way, it was a 5minutes craft for when I have maintenance to do, hope that helps,
From experience, any calls to your endpoints fail