Bug 24651

Summary: Add --maxdays option to the `fines.pl` cronjob to reduce the chance of re-processing very old, already capped, fines.
Product: Koha Reporter: Martin Renvoize <martin.renvoize>
Component: Command-line UtilitiesAssignee: Martin Renvoize <martin.renvoize>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: 1joynelson, daniel.jones, fiona.borthwick, katrin.fischer, kyle, lucy.vaux-harvey, sally.healey
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23571
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16528
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Improve the performances of the fines.pl cronjob by reducing the number of accountlines it targets by this new `--maxdays` option.
Version(s) released in:
20.05.00
Attachments: Bug 24651: Add maxdays option to fines cronjob
Bug 24651: Add maxdays option to fines cronjob
Bug 24651: Add maxdays option to fines cronjob

Description Martin Renvoize 2020-02-13 10:19:34 UTC
This would lead to a performance improvement by simply lowering the number of records that need to be processed.  It would be safe to limit the overdues processed to those under X days overdues given that circulation policy often caps fines at a maximum after a number of days.
Comment 1 Martin Renvoize 2020-02-13 10:49:19 UTC
Created attachment 98806 [details] [review]
Bug 24651: Add maxdays option to fines cronjob

This patch adds an optional maxdays parameter to the fines.pl cronjob.
The new parameter allows system administrators to set a maximum number
of days for the job to process overdues.  This can improve performance.
Comment 2 Martin Renvoize 2020-02-14 12:06:42 UTC
Created attachment 98933 [details] [review]
Bug 24651: Add maxdays option to fines cronjob

This patch adds an optional maxdays parameter to the fines.pl cronjob.
The new parameter allows system administrators to set a maximum number
of days for the job to process overdues.  This can improve performance.

Signed-off-by: Sally Healey <sally.healey@cheshiresharedservices.gov.uk>
Comment 3 Martin Renvoize 2020-02-14 12:10:43 UTC
This has been applied and tested on Cheshire Shared Services production system and they are pleased with the results. Setting the parameter to 6 months has meant that they do not miss any fines in their environment (as all caps will have been reached by this point), but reduced the runtime from 10 hours to 6 minutes (they have a lot of historical checkouts).

Sally asked me to add her signoff line for her :)
Comment 4 Kyle M Hall 2020-02-14 12:30:17 UTC
Created attachment 98938 [details] [review]
Bug 24651: Add maxdays option to fines cronjob

This patch adds an optional maxdays parameter to the fines.pl cronjob.
The new parameter allows system administrators to set a maximum number
of days for the job to process overdues.  This can improve performance.

Signed-off-by: Sally Healey <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Martin Renvoize 2020-02-17 11:32:16 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 6 Joy Nelson 2020-03-05 01:36:39 UTC
enhancement not backported to 19.11.x