]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
scheduler/main.c: Set select timeout to JobHistoryUpdate again 187/head
authorZdenek Dohnal <zdohnal@redhat.com>
Wed, 12 May 2021 14:27:21 +0000 (16:27 +0200)
committerZdenek Dohnal <zdohnal@redhat.com>
Wed, 12 May 2021 14:27:21 +0000 (16:27 +0200)
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 :( .

scheduler/main.c

index 3c7da9f74ca931241e72b37e7046708a1bd57702..3d9ff32af0f8b0d0717092809291fbcac0808c7e 100644 (file)
@@ -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;