Don't log spam when all printers are busy

This commit is contained in:
Reid 'arrdem' McKenzie 2024-09-01 14:12:50 -06:00
parent a815bd6763
commit 824abbe176

View file

@ -162,7 +162,8 @@ def assign_jobs(app: App, db: Db) -> None:
if job.printer_id:
continue
for printer in db.list_idle_printers():
idle = list(db.list_idle_printers())
for printer in idle:
if (
job.analysis_id is not None
and printer.limit_x >= job.max_x
@ -177,7 +178,8 @@ def assign_jobs(app: App, db: Db) -> None:
log.info(f"Mapped job {job.id} to printer {printer.id}")
break
else:
log.info(f"Could not map job {job!r}")
if not idle:
log.info(f"Could not map job {job!r}")
def push_jobs(app: App, db: Db) -> None: