Summary: | Use cache for authority types when linking bibliographic records to authorities | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | MARC Authority data support | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | Needs documenting --- | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | katrin.fischer, lucas, m.de.rooy, phil, wainuiwitikapark |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Small patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: |
24.11.00
|
Circulation function: | |
Attachments: |
Bug 37349: Use cache for authority types and remove extra fetch
Bug 37349: Use cache for authority types and remove extra fetch Bug 37349: Use cache for authority types and remove extra fetch Bug 37349: Use cache for authority types and remove extra fetch Bug 37349: Unit tests Bug 37349: (follow-up) Cache the authority type, not just the key |
Description
Nick Clemens (kidclamp)
2024-07-12 15:56:40 UTC
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! Still waiting for reply on unit test (comment#8) (In reply to Katrin Fischer from comment #10) > Still waiting for reply on unit test (comment#8) Giving up on the test for now. Skipping for release notes as it would be quite technical: 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 Created attachment 174940 [details] [review] Bug 37349: Unit tests This patch adds tests to verify the cahcing of authority type in LinkBibHeadingsToAuthority and adjusts other tests to clear the cache when changing marc flavour Created attachment 174941 [details] [review] Bug 37349: (follow-up) Cache the authority type, not just the key Test were failing because I neglected to store the value in the cache, I was only adding the cache key Picked last 2 patches for main. (In reply to Katrin Fischer from comment #15) > Picked last 2 patches for main. Should I do the same for 24.05? (In reply to Wainui Witika-Park from comment #16) > (In reply to Katrin Fischer from comment #15) > > Picked last 2 patches for main. > > Should I do the same for 24.05? Hi Wainui, I think this patch set is not in 24.05. (In reply to Katrin Fischer from comment #17) > (In reply to Wainui Witika-Park from comment #16) > > (In reply to Katrin Fischer from comment #15) > > > Picked last 2 patches for main. > > > > Should I do the same for 24.05? > > Hi Wainui, I think this patch set is not in 24.05. Ok thanks Katrin! Not backporting to 24.05 unless requested |