From 722b863894b47c48a39230b0248cd7bae5317bba Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Wed, 12 May 2021 16:27:21 +0200 Subject: [PATCH] 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 :( . --- scheduler/main.c | 5 +++++ 1 file changed, 5 insertions(+) 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; -- 2.47.2