diff --git a/.idea/sqldialects.xml b/.idea/sqldialects.xml deleted file mode 100644 index cae4fd3..0000000 --- a/.idea/sqldialects.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/api/search_dict/service.py b/app/api/search_dict/service.py index c76056d..6cd7f9e 100644 --- a/app/api/search_dict/service.py +++ b/app/api/search_dict/service.py @@ -14,7 +14,7 @@ from settings import TORTOISE_ORM async def search_time_updates(redis: Redis) -> None: - key = "search_times" + key = "search_time" await redis.incr(key, 1) diff --git a/app/api/util_api/routes.py b/app/api/util_api/routes.py index 93974b0..c7a6b09 100644 --- a/app/api/util_api/routes.py +++ b/app/api/util_api/routes.py @@ -10,11 +10,11 @@ async def get_search_time(request: Request): key = f"search_time" - count = int(await redis.get(key)) + count = await redis.get(key) if not count: await redis.set(key, value=0) count = 0 - print(count) + print(count, type(count)) return { - "count": count, + "count": int(count), } diff --git a/main.py b/main.py index 8aca619..c1c493f 100644 --- a/main.py +++ b/main.py @@ -19,7 +19,7 @@ from app.api.util_api.routes import ulit_router from app.api.word_comment.routes import word_comment_router from app.core.redis import init_redis, close_redis from app.utils.phone_encrypt import PhoneEncrypt -from settings import ONLINE_SETTINGS +from settings import TORTOISE_ORM @asynccontextmanager @@ -47,7 +47,7 @@ app.add_middleware( register_tortoise( app=app, - config=ONLINE_SETTINGS, + config=TORTOISE_ORM ) app.include_router(users_router, tags=["User API"], prefix="/users")