chore(linter): make ruff happy
This commit is contained in:
@@ -115,9 +115,14 @@ class GeoIPHelper:
|
||||
age_days = (time.time() - os.path.getmtime(path)) / 86400
|
||||
if age_days >= self.max_age_days:
|
||||
need = True
|
||||
logger.info(f"[GeoIP] {eid} database is {age_days:.1f} days old (max: {self.max_age_days}), will download new version")
|
||||
logger.info(
|
||||
f"[GeoIP] {eid} database is {age_days:.1f} days old "
|
||||
f"(max: {self.max_age_days}), will download new version"
|
||||
)
|
||||
else:
|
||||
logger.info(f"[GeoIP] {eid} database is {age_days:.1f} days old, still fresh (max: {self.max_age_days})")
|
||||
logger.info(
|
||||
f"[GeoIP] {eid} database is {age_days:.1f} days old, still fresh (max: {self.max_age_days})"
|
||||
)
|
||||
else:
|
||||
logger.info(f"[GeoIP] {eid} database not found, will download")
|
||||
|
||||
|
||||
@@ -436,5 +436,3 @@ async def get_user_scores(
|
||||
# 处理资源代理
|
||||
processed_scores = await process_response_assets(score_responses, request)
|
||||
return processed_scores
|
||||
|
||||
|
||||
|
||||
@@ -65,7 +65,6 @@ class AssetProxyService:
|
||||
r"https://a\.ppy\.sh/", f"https://{self.avatar_proxy_prefix}.{self.custom_asset_domain}/", result
|
||||
)
|
||||
|
||||
|
||||
return result
|
||||
else:
|
||||
return data
|
||||
|
||||
6
main.py
6
main.py
@@ -39,7 +39,7 @@ from app.service.osu_rx_statistics import create_rx_statistics
|
||||
from app.service.redis_message_system import redis_message_system
|
||||
from app.utils import bg_tasks, utcnow
|
||||
|
||||
from fastapi import Depends, FastAPI, HTTPException, Request
|
||||
from fastapi import FastAPI, HTTPException, Request
|
||||
from fastapi.exceptions import RequestValidationError
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.responses import JSONResponse, RedirectResponse
|
||||
@@ -196,9 +196,7 @@ async def get_user_avatar_root(
|
||||
user_id: int,
|
||||
session: Database,
|
||||
):
|
||||
"""用户头像重定向端点 (根路径)
|
||||
|
||||
"""
|
||||
"""用户头像重定向端点 (根路径)"""
|
||||
user = await session.get(User, user_id)
|
||||
if not user:
|
||||
raise HTTPException(status_code=404, detail="User not found")
|
||||
|
||||
Reference in New Issue
Block a user