LinkBibHeadingstoAuthorities fetches the authority type for the heading for each heading, sometimes more than once, we can improve this
Created attachment 168922 [details] [review] Bug 37349: Use cache for authority types and remove extra fetch This patch caches the authority types when fetched during linking to avoid grabbing the same type more than once. Additionally it removes a second call to fetch the same type in some scenarios To test: 1 - Apply patch 2 - Enable linking during cataloging/updating records 3 - Edit a record and confirm it is linked ocrrectly 4 - Run the authority linking cron and confirm it works as expected
Created attachment 170142 [details] [review] Bug 37349: Use cache for authority types and remove extra fetch This patch caches the authority types when fetched during linking to avoid grabbing the same type more than once. Additionally it removes a second call to fetch the same type in some scenarios To test: 1 - Apply patch 2 - Enable linking during cataloging/updating records 3 - Edit a record and confirm it is linked ocrrectly 4 - Run the authority linking cron and confirm it works as expected
Even though I've never had the need to modify an authority type's auth_tag_to_report, shouldn't doing so invalidate the cache? Or at least have a warning in admin/authtypes.pl?op=add_form that restarting Koha is required for it to take effect?
The code here is using the L1 cache, this is cleared for every request i.e. if you change a type it will be picked up in the next code call - this just ensures it is cached during a single process run
Created attachment 170211 [details] [review] Bug 37349: Use cache for authority types and remove extra fetch This patch caches the authority types when fetched during linking to avoid grabbing the same type more than once. Additionally it removes a second call to fetch the same type in some scenarios To test: 1 - Apply patch 2 - Enable linking during cataloging/updating records 3 - Edit a record and confirm it is linked ocrrectly 4 - Run the authority linking cron and confirm it works as expected Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Created attachment 170436 [details] [review] Bug 37349: Use cache for authority types and remove extra fetch This patch caches the authority types when fetched during linking to avoid grabbing the same type more than once. Additionally it removes a second call to fetch the same type in some scenarios To test: 1 - Apply patch 2 - Enable linking during cataloging/updating records 3 - Edit a record and confirm it is linked ocrrectly 4 - Run the authority linking cron and confirm it works as expected Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(In reply to Nick Clemens (kidclamp) from comment #0) > LinkBibHeadingstoAuthorities fetches the authority type for the heading for > each heading, sometimes more than once, we can improve this Moving to enh
Should we have a unit test for this change to C4/Biblio.pm? t/db_dependent/Biblio.t passes.
Pushed for 24.11! Well done everyone, thank you!