]> git.ipfire.org Git - thirdparty/cups.git/commit
scheduler: Fix cleaning jobs by loading times when needed
authorzdohnal <zdohnal@redhat.com>
Thu, 10 Jul 2025 15:26:01 +0000 (17:26 +0200)
committerGitHub <noreply@github.com>
Thu, 10 Jul 2025 15:26:01 +0000 (17:26 +0200)
commit42675e5b01dc2cd7950d2cf58eb01e27c40af8df
treeccccd503261ddf6bee026c2b7bd726e75a0f1e18
parentbcb4814ead58a66f96b7d33d8b90cd56ac3864af
parente129afd55ae9873451f6d5299bbaff19b42d2098
scheduler: Fix cleaning jobs by loading times when needed

Currently if we load jobs from job.cache, we don't set correct times for history_time and file_time, resulting them in being 0 and the jobs avoids the cleanup by cupsd when needed, leading into eating up memory space.

It happens because none of the functions which set those job members are not called - cupsdSetJobState() is used when changing job states, cupsdUpdateJobs() during partial reload and cupsdLoadJob() is guarded by condition in load_job_cache().

The fix is to change conditional in load_job_cache() which will cause loading of the job if cupsd is set to clean up job history, or if cupsd should clean up job files and the job still has some.