[Koha-bugs] [Bug 29474] Automatic renewals cronjob is slow on systems with large numbers of reserves

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Dec 2 16:52:03 CET 2021


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

--- Comment #44 from Nick Clemens <nick at bywatersolutions.com> ---
(In reply to Jonathan Druart from comment #42)
> I agree with most of the changes, but I don't think it's a good idea to pass
> the issuing rules and the "soonest date". It's just hiding problem with the
> code, which shouldn't be resolved that way.
> 
> For instance if we are facing perf issues with the fetch of the circ rules,
> we should then cache them. Other areas would benefit from that kind of
> change. Code will stay clean and we wouldn't need write acrobatic code in
> this C4::Circ module, it does not need that :)

I see your point, however, in this instance _CanBookBeAutoRenewed is just a
helper function here, moved out to make the logic easier to read. Passing
variables we are fetching that are common to both routines seems logical to me.
It's not so much that there is a perf problem fetching them, but that we are
fetching the same data here multiple times

(In reply to Jonathan Druart from comment #43)
> And... thinking loud, sorry for the noise if it does not make sense.
> 
> There is a _CanBookBeAutoRenewed sub but we are still doing "auto renewal"
> related checks in CanBookBeRenewed. It should be simpler than that actually,
> we should call _CanBookBeAutoRenewed that will call CanBookBeRenewed, not
> the reverse.
> 
> Ideally
>   Koha::AutoRenewalHold inherit from Koha::Hold
>   Koha::AutoRenewalHold->can_be_renewed will do its specific check for auto
> renew then can SUPER::can_be_renewed
> 
I assume you mean 'Issue' not 'Hold'

> Aren't we actually doing the reverse here?

Automatic renewals and renewals are not discrete - a regular renewal block will
prevent auto_renewal and is cheaper to check the simple bits first - it makes
sense to go through the simple renewal checks that will block, before checking
the auto_renewal blocks.

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


More information about the Koha-bugs mailing list