fix: Fixed importing aioredis causing an error in Python 3.11
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
from typing import Any, Union, Tuple, List, Set
|
from typing import Any, Union, Tuple, List, Set
|
||||||
|
|
||||||
import aioredis
|
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
from redis import asyncio as aioredis
|
||||||
|
|
||||||
from ..exception.RedisException import RedisException
|
from ..exception.RedisException import RedisException
|
||||||
from ..utils import config
|
from ..utils import config
|
||||||
@@ -32,7 +32,7 @@ async def expire(key: str, seconds: int):
|
|||||||
|
|
||||||
|
|
||||||
async def exists(key: str) -> bool:
|
async def exists(key: str) -> bool:
|
||||||
return await __redis.exists(key)
|
return bool(await __redis.exists(key))
|
||||||
|
|
||||||
|
|
||||||
async def get(key: str) -> str:
|
async def get(key: str) -> str:
|
||||||
|
|||||||
Reference in New Issue
Block a user