From: Zdenek Dohnal Date: Wed, 12 May 2021 14:27:21 +0000 (+0200) Subject: scheduler/main.c: Set select timeout to JobHistoryUpdate again X-Git-Tag: v2.4b1~118^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=722b863894b47c48a39230b0248cd7bae5317bba;p=thirdparty%2Fcups.git scheduler/main.c: Set select timeout to JobHistoryUpdate again The commit 9bdea94b145 introduced a regression in job control and data files cleanup. If user sets PreserveJobHistory and PreserveJobFiles, prints a file and stops cupsd before files are cleaned up, the files aren't removed after cupsd restarts and the timeouts for removal are reached. The files will be removed if user uses command 'lpstat -W completed -o' or by another cupsd restart after time passes JobHistoryUpdate, so workarounds exist, however the current behavior is strange :( . --- diff --git a/scheduler/main.c b/scheduler/main.c index 3c7da9f74c..3d9ff32af0 100644 --- a/scheduler/main.c +++ b/scheduler/main.c @@ -1731,6 +1731,11 @@ select_timeout(int fds) /* I - Number of descriptors returned */ /* * Check for any job activity... */ + if (JobHistoryUpdate && timeout > JobHistoryUpdate) + { + timeout = JobHistoryUpdate; + why = "update job history"; + } for (job = (cupsd_job_t *)cupsArrayFirst(ActiveJobs); job;