[Koha-bugs] [Bug 34027] Add functionality to cleanup_database.pl to purge action logs in batches

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jun 16 04:12:42 CEST 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34027

--- Comment #1 from Aleisha Amohia <aleisha at catalyst.net.nz> ---
Created attachment 152394
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152394&action=edit
Bug 34027: Add functionality to cleanup_database.pl to purge action logs in
batches

This enhancement gives libraries the option to purge action logs 'slowly', in
batches. This is useful for when there are many, many rows to purge (i.e.
millions).

To test, set up some sample logs (you'll need to change the timestamp in the
database so they are picked up by the cronjob), run the cleanup_database.pl
script with the --logs parameter and confirm it behaves as expected.

For example:

sudo koha-foreach --chdir --enabled
/kohadevbox/koha/misc/cronjobs/cleanup_database.pl --confirm --logs 1
--logs-batch 500 --verbose

Test cases:

1. logs argument, no logs-batch argument. Cleanup should run as normal, in one
query.

sudo koha-foreach --chdir --enabled
/kohadevbox/koha/misc/cronjobs/cleanup_database.pl --confirm --logs 1 --verbose

2. logs argument, logs-batch argument with no ROWS specified. logs-batch should
default to 1000, deletions done in batches of 1000 rows at a time.

sudo koha-foreach --chdir --enabled
/kohadevbox/koha/misc/cronjobs/cleanup_database.pl --confirm --logs 1
--logs-batch --verbose

3. logs argument, logs-batch argument with ROWS specified. Deletions should be
done in batches of the specified ROWS

sudo koha-foreach --chdir --enabled
/kohadevbox/koha/misc/cronjobs/cleanup_database.pl --confirm --logs 1
--logs-batch 500 --verbose

Sponsored-by: Auckland University of Technology

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list