Don't log spam when all printers are busy
This commit is contained in:
parent
a815bd6763
commit
824abbe176
1 changed files with 4 additions and 2 deletions
|
@ -162,7 +162,8 @@ def assign_jobs(app: App, db: Db) -> None:
|
||||||
if job.printer_id:
|
if job.printer_id:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
for printer in db.list_idle_printers():
|
idle = list(db.list_idle_printers())
|
||||||
|
for printer in idle:
|
||||||
if (
|
if (
|
||||||
job.analysis_id is not None
|
job.analysis_id is not None
|
||||||
and printer.limit_x >= job.max_x
|
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}")
|
log.info(f"Mapped job {job.id} to printer {printer.id}")
|
||||||
break
|
break
|
||||||
else:
|
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:
|
def push_jobs(app: App, db: Db) -> None:
|
||||||
|
|
Loading…
Reference in a new issue