refactor(detector): more readable

This commit is contained in:
MingxuanGame
2025-08-15 08:52:01 +00:00
parent 7c7c68c163
commit 814d9c4618
7 changed files with 40 additions and 110 deletions

View File

@@ -1,4 +1,3 @@
import asyncio
from collections.abc import Sequence
from datetime import UTC, date, datetime
import json
@@ -726,9 +725,7 @@ async def process_score(
)
if can_get_pp:
beatmap_raw = await fetcher.get_or_fetch_beatmap_raw(redis, beatmap_id)
pp = await asyncio.get_event_loop().run_in_executor(
None, calculate_pp, score, beatmap_raw
)
pp = await calculate_pp(score, beatmap_raw, session)
score.pp = pp
session.add(score)
user_id = user.id