[Koha-bugs] [Bug 32476] Add caching for relatively expensive patron methods

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jul 11 14:08:54 CEST 2023


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

Nick Clemens <nick at bywatersolutions.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick at bywatersolutions.com

--- Comment #30 from Nick Clemens <nick at bywatersolutions.com> ---
I like this too, but it does seem to make things a little more confusing to my
mind when reading patron code.

I wonder if it might be simpler to add $patron->can_renew /
$patron->can_auto_renew functions, cached in the L1 cache, which check both the
system preferences and patron values that are needed to make this
determination.

We could either call these  in CanBookBeRenewed/_CanBookBeAutoRenewed - or
avoid the calls all together:
my ( $can_renew, $can_renew_error, $info ) = CanBookBeRenewed(
$checkout_obj->patron, $checkout_obj ) if $patron->can_renew();

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


More information about the Koha-bugs mailing list