[Koha-bugs] [Bug 29623] Cache circulation rules
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Tue May 31 07:33:57 CEST 2022
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29623
--- Comment #13 from Jonathan Druart <jonathan.druart+koha at gmail.com> ---
(In reply to David Cook from comment #11)
> Comment on attachment 134209 [details] [review]
> Bug 29623: Cache circulation rules
>
> Review of attachment 134209 [details] [review]:
> -----------------------------------------------------------------
>
> ::: Koha/CirculationRules.pm
> @@ +379,5 @@
> > + my $memory_cache = Koha::Cache::Memory::Lite->get_instance;
> > + my $cache_key = sprintf "CircRules:%s:%s:%s:%s", $rule_name // q{},
> > + $categorycode // q{}, $branchcode // q{}, $itemtype // q{};
> > +
> > + Koha::Cache::Memory::Lite->flush();
>
> It looks like the $memory_cache and $cache_key variables are initialised but
> unused?
Looks like a leftover. I think I first put the code there then moved it into
the other method.
> @@ +410,4 @@
> > push( @$rule_objects, $rule_object );
> > }
> >
> > + Koha::Cache::Memory::Lite->flush();
>
> Is this necessary since the cache should be cleared at the end of the HTTP
> request? Or is this to provide for cases where the method is called outside
> a HTTP context?
Hum, that's bad indeed.
I think we need to flush (as the cache contains old values now), or update the
cache's values, but we shouldn't flush the whole memory cache.
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list