Summary: | cleanup_database.pl bg-jobs parameter should be bg-days | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Command-line Utilities | Assignee: | Katrin Fischer <katrin.fischer> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | david, robin |
Version: | Main | Keywords: | rel_22_11_candidate |
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: |
22.11.00
|
|
Circulation function: | |||
Bug Depends on: | 31969 | ||
Bug Blocks: | |||
Attachments: |
Bug 32093: Make help and code match for bg-days in cleanup_database.pl
Bug 32093: Make help and code match for bg-days in cleanup_database.pl Bug 32093: Make help and code match for bg-days in cleanup_database.pl |
Description
Nick Clemens (kidclamp)
2022-11-03 14:24:17 UTC
Created attachment 143921 [details] [review] Bug 32093: Make help and code match for bg-days in cleanup_database.pl There as a mismatch between the parameter name in documentation (bg-days) and what was checked in the code (bg-jobs). This makes both match. To test: * Apply patch * Make sure you have some background_jobs older than one day * Verify the help of the script documents the parameter bg-days * Run the cleanup_database.pl job Example: ./misc/cronjobs/cleanup_database.pl --bg-days --confirm -v * Verify there are no errors and the lines have been deleted as expected As this new option has not been released yet, we should push this before release so people can have it right from the beginning. Created attachment 143930 [details] [review] Bug 32093: Make help and code match for bg-days in cleanup_database.pl There as a mismatch between the parameter name in documentation (bg-days) and what was checked in the code (bg-jobs). This makes both match. To test: * Apply patch * Make sure you have some background_jobs older than one day * Verify the help of the script documents the parameter bg-days * Run the cleanup_database.pl job Example: ./misc/cronjobs/cleanup_database.pl --bg-days --confirm -v * Verify there are no errors and the lines have been deleted as expected Signed-off-by: David Nind <david@davidnind.com> Testing notes (using KTD): 1. To create some background jobs that could be purged (I'm sure there are quicker ways), I: - Enabled Elasticsearch (SearchEngine) - Reindexed (koha-elasticsearch --rebuild -d -b -a kohadev) - Edited some records (changed titles) - Updated the dates in the database for background jobs so that they are more than 1 day old (wasn't sure what date is used to trigger pruging): . select * from background_jobs; . update background_jobs set enqueued_on = "2022-11-13 20:09:00"; . update background_jobs set started_on = "2022-11-13 20:09:00"; . update background_jobs set ended_on = "2022-11-13 20:10:00"; - Edited a few more records (changed title) 2. Ran the cleanup_database.pl job. 3. Checked that the older background jobs were deleted in the database and UI. Created attachment 144020 [details] [review] Bug 32093: Make help and code match for bg-days in cleanup_database.pl There as a mismatch between the parameter name in documentation (bg-days) and what was checked in the code (bg-jobs). This makes both match. To test: * Apply patch * Make sure you have some background_jobs older than one day * Verify the help of the script documents the parameter bg-days * Run the cleanup_database.pl job Example: ./misc/cronjobs/cleanup_database.pl --bg-days --confirm -v * Verify there are no errors and the lines have been deleted as expected Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Pushed to master for 22.11. Nice work everyone, thanks! |