fix error
This commit is contained in:
@@ -13,7 +13,7 @@ from .router import router
|
|||||||
|
|
||||||
from fastapi import BackgroundTasks, Path, Query, Security
|
from fastapi import BackgroundTasks, Path, Query, Security
|
||||||
from pydantic import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
from sqlmodel import col, select, func
|
from sqlmodel import col, func, select
|
||||||
|
|
||||||
|
|
||||||
class TeamStatistics(BaseModel):
|
class TeamStatistics(BaseModel):
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ Beatmapset缓存服务
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
import hashlib
|
import hashlib
|
||||||
import json
|
import json
|
||||||
from datetime import datetime
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from app.config import settings
|
from app.config import settings
|
||||||
@@ -17,7 +17,7 @@ from app.log import logger
|
|||||||
from redis.asyncio import Redis
|
from redis.asyncio import Redis
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from app.fetcher import Fetcher
|
pass
|
||||||
|
|
||||||
|
|
||||||
class DateTimeEncoder(json.JSONEncoder):
|
class DateTimeEncoder(json.JSONEncoder):
|
||||||
@@ -199,7 +199,7 @@ _cache_service: BeatmapsetCacheService | None = None
|
|||||||
|
|
||||||
def get_beatmapset_cache_service(redis: Redis) -> BeatmapsetCacheService:
|
def get_beatmapset_cache_service(redis: Redis) -> BeatmapsetCacheService:
|
||||||
"""获取beatmapset缓存服务实例"""
|
"""获取beatmapset缓存服务实例"""
|
||||||
global _cache_service # noqa: PLW0603
|
global _cache_service
|
||||||
if _cache_service is None:
|
if _cache_service is None:
|
||||||
_cache_service = BeatmapsetCacheService(redis)
|
_cache_service = BeatmapsetCacheService(redis)
|
||||||
return _cache_service
|
return _cache_service
|
||||||
|
|||||||
Reference in New Issue
Block a user