Skip to content

Commit

Permalink
fix aioredis
Browse files Browse the repository at this point in the history
  • Loading branch information
dungeon-master-666 committed Nov 12, 2023
1 parent 0382317 commit 2ff2319
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions ton-http-api/pyTON/cache.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import aioredis
import redis.asyncio
import ring

from ring.func.asyncio import Aioredis2Storage
Expand Down Expand Up @@ -29,8 +29,7 @@ def wrapper(*args, **kwargs):
class RedisCacheManager:
def __init__(self, cache_settings: RedisCacheSettings):
self.cache_settings = cache_settings
self.cache_redis = aioredis.from_url(f"redis://{cache_settings.redis.endpoint}:{cache_settings.redis.port}")
print(f"WARNING! {self.cache_redis}")
self.cache_redis = redis.asyncio.from_url(f"redis://{cache_settings.redis.endpoint}:{cache_settings.redis.port}")

def cached(self, expire=0, check_error=True):
storage_class = TonlibResultRedisStorage if check_error else Aioredis2Storage
Expand Down
4 changes: 2 additions & 2 deletions ton-http-api/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
aioredis>=2.0.1
redis==5.0.1
loguru>=0.6.0
fastapi>=0.78.0,<0.79.0
pydantic>=1.9.1,<2.0.0
requests>=2.28.0
ring>=0.9.1
ring==0.10.1
uvicorn>=0.17.6
gunicorn>=20.1.0
pytonlib==0.0.51
Expand Down
4 changes: 2 additions & 2 deletions ton-http-api/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
version=version,
packages=find_packages('.', exclude=['tests']),
install_requires=[
'aioredis>=2.0.1',
'redis==5.0.1',
'loguru>=0.6.0',
'fastapi>=0.78.0',
'pydantic>=1.9.1',
'requests>=2.28.0',
'ring>=0.9.1',
'ring==0.10.1',
'uvicorn>=0.17.6',
'gunicorn>=20.1.0',
'pytonlib==0.0.43',
Expand Down

0 comments on commit 2ff2319

Please sign in to comment.