]> git.ipfire.org Git - thirdparty/cups.git/commit
scheduler: Fix cleaning jobs by loading times when needed 2.4.x
authorZdenek Dohnal <zdohnal@redhat.com>
Tue, 15 Jul 2025 11:16:52 +0000 (13:16 +0200)
committerZdenek Dohnal <zdohnal@redhat.com>
Tue, 15 Jul 2025 11:16:52 +0000 (13:16 +0200)
commit69550a07ae668b4ec4a4afc55e7370018b61e09b
treeaf93858dd33aacb3089fe4df525231a026e12eeb
parent2c78a6998a4822f728a13805cac2b710223afdce
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.
CHANGES.md
scheduler/job.c