style(gpu): ruff — split as-import, dict(rows) over comprehension
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ttrj5P7upUTueSfoJcxEqa
This commit is contained in:
@@ -76,7 +76,7 @@ async def status():
|
|||||||
select(GpuJob.status, func.count()).group_by(GpuJob.status)
|
select(GpuJob.status, func.count()).group_by(GpuJob.status)
|
||||||
)
|
)
|
||||||
).all()
|
).all()
|
||||||
counts = {s: c for s, c in rows}
|
counts = dict(rows)
|
||||||
return jsonify({
|
return jsonify({
|
||||||
"pending": counts.get("pending", 0),
|
"pending": counts.get("pending", 0),
|
||||||
"leased": counts.get("leased", 0),
|
"leased": counts.get("leased", 0),
|
||||||
|
|||||||
@@ -745,7 +745,8 @@ def enqueue_gpu_backfill(task_name: str) -> int:
|
|||||||
"""Enqueue a gpu_job for every image that doesn't already have one for
|
"""Enqueue a gpu_job for every image that doesn't already have one for
|
||||||
`task_name` (one INSERT…SELECT, so it scales to a full library). The desktop
|
`task_name` (one INSERT…SELECT, so it scales to a full library). The desktop
|
||||||
agent drains the queue over HTTP. Returns the number enqueued."""
|
agent drains the queue over HTTP. Returns the number enqueued."""
|
||||||
from sqlalchemy import exists, insert, literal, select as sa_select
|
from sqlalchemy import exists, insert, literal
|
||||||
|
from sqlalchemy import select as sa_select
|
||||||
|
|
||||||
from ..models import GpuJob, ImageRecord
|
from ..models import GpuJob, ImageRecord
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user