[Koha-bugs] [Bug 29623] Cache circulation rules

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Jun 1 08:55:17 CEST 2022


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

--- Comment #21 from Jonathan Druart <jonathan.druart+koha at gmail.com> ---
(In reply to David Cook from comment #18)
> (In reply to Jonathan Druart from comment #15)
> > I think this is the correct approach, what do you think?
> 
> I'm not 100% sure. 
> 
> I find that the code in ./admin/smart-rules.pl and Koha/CirculationsRules.pm
> is very messy.

Let's say all our code is messy and so we don't need to tell it every week,
deal?

> If we clear the cache after each set_rule() call, we'll be calling the
> function ~38 times (so 38 loops) for each add/update/delete in
> ./admin/smart-rules.pl. We should only need to call it 1 time for each CRUD
> operation.

We could add a flag to set_rule to not clear the cache, and clear it from
set_rules. Would that work for you?

> In fact, since we're using the L1 cache and the L1 cache is flushed at the
> end of every HTTP/SIP request, clearing the cache (in
> ./admin/smart-rules.pl) is actually probably totally unnecessary for
> production purposes. 

Seems a good practices to invalided the cache when the value might have
changed. That will prevent bugs in the future.

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


More information about the Koha-bugs mailing list