[Koha-bugs] [Bug 23571] Prevent concurrent execution of fines.pl

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Apr 13 15:52:18 CEST 2020


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

Kyle M Hall <kyle at bywatersolutions.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #102821|0                           |1
        is obsolete|                            |

--- Comment #24 from Kyle M Hall <kyle at bywatersolutions.com> ---
Created attachment 102844
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102844&action=edit
Bug 23571: Prevent concurrent execution of fines.pl

This patch introduces locking in fines.pl. It does so by leveraging on
bug 25109, which introduces a generic locking implementation on
Koha::Script.

The introduced changes:
1. Try to get the lock
2.a. If success, normal execution happens
2.b. If rejected, cronlogaction is called with a meaningful message and
  a normal exit happens, so we don't flood the logs in vain. --verbose
  will make the script print the same message on STDERR, as already is
  the case with this script

To test:
1. Apply this patch
2. In two separate consoles run:
   $ kshell
  k$ perl misc/cronjobs/fines.pl --verbose
SUCCESS => The first one runs normally, the second one exists really fast
  and prints a message about the lock.
3. Sign off :-D

Sponsored-by: Orex Digital

Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>

Amended-pach JD: Fix syntax issue (typo Koha::Scrip and ';' after the
catch block)

Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>

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


More information about the Koha-bugs mailing list