Skip to content

Commit

Permalink
Merge pull request #364 from zdohnal/temp_queues_cleanup
Browse files Browse the repository at this point in the history
scheduler/printers.c: Don't remove processing temp queue
  • Loading branch information
zdohnal authored Apr 7, 2022
2 parents b4e1e95 + 3dfc8ca commit 480b43f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scheduler/printers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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);
}
}
Expand Down

0 comments on commit 480b43f

Please sign in to comment.