-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aioredis is deprecated #11
Comments
Same happened here. Unable to use |
@joliss @skulltech I'm also experiencing this issue, thought I would check in with both of you to see if you found a work around to use openlimit |
@shaggy2626 if you aren't using Redis, I was able to make it work with the following changes based on this thread: diff --git a/openlimit/buckets/redis_bucket.py b/openlimit/buckets/redis_bucket.py
index eb84428..67e64aa 100644
--- a/openlimit/buckets/redis_bucket.py
+++ b/openlimit/buckets/redis_bucket.py
@@ -4,9 +4,9 @@ import time
import typing
# Third party
-import aioredis
-import aioredis.client
-import aioredis.lock
+from redis import asyncio as aioredis
######
# MAIN
diff --git a/openlimit/buckets/redis_buckets.py b/openlimit/buckets/redis_buckets.py
index e08653b..af49676 100644
--- a/openlimit/buckets/redis_buckets.py
+++ b/openlimit/buckets/redis_buckets.py
@@ -2,8 +2,8 @@ import asyncio
from contextlib import AsyncExitStack, ExitStack
from typing import Optional
-import aioredis
-import aioredis.client
+from redis import asyncio as aioredis
from openlimit.buckets.redis_bucket import RedisBucket
diff --git a/openlimit/redis_rate_limiters.py b/openlimit/redis_rate_limiters.py
index 644160c..087b88f 100644
--- a/openlimit/redis_rate_limiters.py
+++ b/openlimit/redis_rate_limiters.py
@@ -2,7 +2,7 @@
import asyncio
# Third party
-import aioredis
+from redis import asyncio as aioredis
# Local
import openlimit.utilities as utils This might also work with Redis, although I haven't tested it. |
Thank you for the update. Im not using redis, would i still need to use this? openlimit/buckets/redis_bucket.py ? |
aioredis has been deprecated as it is now included in the official redis Python package. As aioredis fails to import on Python 3.11+, it prevents me from using openlimit, even if I don't use Redis at all. So it would be great to update the dependency to the official redis package, which hopefully doesn't suffer from this problem.
The text was updated successfully, but these errors were encountered: