Summary: | cleanup_database.pl should remove not only finished background jobs | ||
---|---|---|---|
Product: | Koha | Reporter: | Fridolin Somers <fridolin.somers> |
Component: | Command-line Utilities | Assignee: | Fridolin Somers <fridolin.somers> |
Status: | In Discussion --- | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | robin, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 31969 | ||
Bug Blocks: | |||
Attachments: | Bug 35948: cleanup_database.pl should remove not only finished background jobs |
Description
Fridolin Somers
2024-01-30 14:30:23 UTC
So we should use "enqueued_on" instead of "ended_on" and no filter on status Created attachment 161646 [details] [review] Bug 35948: cleanup_database.pl should remove not only finished background jobs Bug 31969 changed cleanup_database.pl so it removes only finished background jobs. But old background jobs with other statuses will never be removed. So we should use "enqueued_on" instead of "ended_on" and no filter on status Test plan : 1) Create a background job with for example a batch item modification 2) Simulate ancien job via SQL : update background_jobs set status='failed',enqueued_on=DATE_SUB(NOW(),INTERVAL 10 DAY) where id=X 3) Run misc/cronjobs/cleanup_database.pl --jobs-days 9 --jobs-type all -v --confirm 4) Check the job is removed Currently we have a lot of problems with jobs not finishing. Would this not only hide the problem? I feel it should be an option and not a change of behaviour. @Fridolin: see bug 35092 What are the other "final" statues that should be cleaned? Certainly there should be "cancelled". And on the long run, "failed" also. Not sure about now because that might hide the current issues if --jobs-days is too small. But maybe it ok, I don't know. Ah sure, cancelled is missing. I set status to needs discussion ;) Anything else to cleanup besides cancelled and failed? |