feat: Add redis util

This commit is contained in:
LWR
2022-10-29 18:34:28 +08:00
parent 21b5ddbe56
commit 1f93b92dc0
4 changed files with 85 additions and 2 deletions
+11 -2
View File
@@ -2,8 +2,10 @@ import sys
from loguru import logger
from starbot.core.datasource import DataSource
from starbot.exception.DataSourceException import DataSourceException
from .datasource import DataSource
from ..exception.DataSourceException import DataSourceException
from ..exception.RedisException import RedisException
from ..utils import redis
class StarBot:
@@ -56,3 +58,10 @@ class StarBot:
except DataSourceException as ex:
logger.error(ex.msg)
return
# 连接 Redis
try:
await redis.init()
except RedisException as ex:
logger.error(ex.msg)
return