style: 统一 Ruff 代码格式
This commit is contained in:
@@ -20,8 +20,10 @@ from typing import TYPE_CHECKING
|
||||
if TYPE_CHECKING:
|
||||
from .huya_runner import HuyaBatchRunner
|
||||
|
||||
|
||||
class HuyaBatchRunnerCore:
|
||||
"""虎牙任务执行器公共基础:批次状态、日志、任务落库。"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
db: Session,
|
||||
@@ -156,7 +158,8 @@ class HuyaBatchRegistry:
|
||||
expired = [
|
||||
batch_id
|
||||
for batch_id, batch in self._batches.items()
|
||||
if batch.get("finished") and now - float(batch.get("finished_at") or now) > ttl_seconds
|
||||
if batch.get("finished")
|
||||
and now - float(batch.get("finished_at") or now) > ttl_seconds
|
||||
]
|
||||
for batch_id in expired:
|
||||
self._batches.pop(batch_id, None)
|
||||
@@ -206,4 +209,3 @@ class HuyaBatchRegistry:
|
||||
|
||||
|
||||
huya_batch_registry = HuyaBatchRegistry()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user