fix(statistics): run recalculate independently
This commit is contained in:
@@ -537,7 +537,9 @@ def calculate_playtime(score: Score, beatmap_length: int) -> tuple[int, bool]:
|
||||
+ (score.nsmall_tick_hit or 0)
|
||||
)
|
||||
total_obj = 0
|
||||
for statistics, count in score.maximum_statistics.items():
|
||||
for statistics, count in (
|
||||
score.maximum_statistics.items() if score.maximum_statistics else {}
|
||||
):
|
||||
if not isinstance(statistics, HitResult):
|
||||
statistics = HitResult(statistics)
|
||||
if statistics.is_scorable():
|
||||
|
||||
@@ -10,7 +10,6 @@ scheduler: AsyncIOScheduler | None = None
|
||||
def init_scheduler():
|
||||
global scheduler
|
||||
scheduler = AsyncIOScheduler(timezone=UTC)
|
||||
scheduler.start()
|
||||
|
||||
|
||||
def get_scheduler() -> AsyncIOScheduler:
|
||||
@@ -20,6 +19,12 @@ def get_scheduler() -> AsyncIOScheduler:
|
||||
return scheduler # pyright: ignore[reportReturnType]
|
||||
|
||||
|
||||
def start_scheduler():
|
||||
global scheduler
|
||||
if scheduler is not None:
|
||||
scheduler.start()
|
||||
|
||||
|
||||
def stop_scheduler():
|
||||
global scheduler
|
||||
if scheduler:
|
||||
|
||||
Reference in New Issue
Block a user