From 3dfc8caa5829b2028b3df7dccd24fb6d8a049d25 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Wed, 6 Apr 2022 11:18:11 +0200 Subject: [PATCH] scheduler/printers.c: Don't remove processing temp queue cupsdDeleteTemporaryPrinters() deletes temporary queues which their last status was updated 1 minute ago or older. It doesn't take into account the fact the printer can be processing a big print job and cupsd deletes the temp queue either way. The fix in the PR now set cupsd to ignore queues which are in processing state. If the delay in job processing is caused by an error in printer, the correct error should kick in IPP backend. --- scheduler/printers.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scheduler/printers.c b/scheduler/printers.c index fffb4e7b83..7a5791ba1e 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -883,6 +883,9 @@ cupsdDeleteTemporaryPrinters(int force) /* I - Force deletion instead of auto? * time_t unused_time; /* Last time for printer state change */ + cupsdLogMessage(CUPSD_LOG_DEBUG2, + "cupsdDeleteTemporaryPrinters: Removing unused temporary printers"); + /* * Allow temporary printers to stick around for 60 seconds after the last job * completes. @@ -892,7 +895,8 @@ cupsdDeleteTemporaryPrinters(int force) /* I - Force deletion instead of auto? * for (p = (cupsd_printer_t *)cupsArrayFirst(Printers); p; p = (cupsd_printer_t *)cupsArrayNext(Printers)) { - if (p->temporary && (force || p->state_time < unused_time)) + if (p->temporary && + (force || (p->state_time < unused_time && p->state != IPP_PSTATE_PROCESSING))) cupsdDeletePrinter(p, 0); } } -- 2.47.2