Summary: | bulkmarcimport.pl disables syspref caching | ||
---|---|---|---|
Product: | Koha | Reporter: | Ian Walls <ian> |
Component: | Tools | Assignee: | Ian Walls <ian> |
Status: | CLOSED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | minor | ||
Priority: | P5 - low | CC: | 1joynelson, black23, dcook, hayleypelham, lucas, m.de.rooy |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
20.05.00, 19.11.03, 19.05.08
|
|
Circulation function: | |||
Attachments: |
Bug 23377: use ENV syspref override instead of complete disable
Bug 23377: use ENV syspref override instead of complete disable Bug 23377: use ENV syspref override instead of complete disable Bug 23377: (QA follow-up) Use OVERRIDE_SYSPREF |
Description
Ian Walls
2019-07-25 20:04:41 UTC
Created attachment 91898 [details] [review] Bug 23377: use ENV syspref override instead of complete disable In an attempt to save time, bulkmarcimport temporarily sets CataloguingLog and AuthoritiesLog to 0. It does this by disabling syspref caching and saving the changes to the database (then replacing the original values at completion). Unfortunately, this disables other key sysprefs from being cached, and results in a 50% increase in processing time for the script. This patch instead utilizes the ENV variable override feature of sysprefs, which preempts the cache in C4::Context->preference(). To test: 1. Perform a bulkmarcimport with a reasonable number of biblios (~1000 will do) 2. Note the time taken to complete 3. Apply patch 4. Revert the biblio load performed 5. Perform another bulkmarcimport with the same biblios and commandline options 6. Note the time taken to complete 7. Compare times. The time from step 6 should be about 33% less than the time from step 2 8. Check Cataloguing and Authorities Logs to verify imported records were not logged 9. Profit! Created attachment 97143 [details] [review] Bug 23377: use ENV syspref override instead of complete disable In an attempt to save time, bulkmarcimport temporarily sets CataloguingLog and AuthoritiesLog to 0. It does this by disabling syspref caching and saving the changes to the database (then replacing the original values at completion). Unfortunately, this disables other key sysprefs from being cached, and results in a 50% increase in processing time for the script. This patch instead utilizes the ENV variable override feature of sysprefs, which preempts the cache in C4::Context->preference(). To test: 1. Perform a bulkmarcimport with a reasonable number of biblios (~1000 will do) 2. Note the time taken to complete 3. Apply patch 4. Revert the biblio load performed 5. Perform another bulkmarcimport with the same biblios and commandline options 6. Note the time taken to complete 7. Compare times. The time from step 6 should be about 33% less than the time from step 2 8. Check Cataloguing and Authorities Logs to verify imported records were not logged 9. Profit! Signed-off-by: Michal Denar <black23@gmail.com> Looking here Created attachment 97183 [details] [review] Bug 23377: use ENV syspref override instead of complete disable In an attempt to save time, bulkmarcimport temporarily sets CataloguingLog and AuthoritiesLog to 0. It does this by disabling syspref caching and saving the changes to the database (then replacing the original values at completion). Unfortunately, this disables other key sysprefs from being cached, and results in a 50% increase in processing time for the script. This patch instead utilizes the ENV variable override feature of sysprefs, which preempts the cache in C4::Context->preference(). To test: 1. Perform a bulkmarcimport with a reasonable number of biblios (~1000 will do) 2. Note the time taken to complete 3. Apply patch 4. Revert the biblio load performed 5. Perform another bulkmarcimport with the same biblios and commandline options 6. Note the time taken to complete 7. Compare times. The time from step 6 should be about 33% less than the time from step 2 8. Check Cataloguing and Authorities Logs to verify imported records were not logged 9. Profit! Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 97184 [details] [review] Bug 23377: (QA follow-up) Use OVERRIDE_SYSPREF SYSPREF_OVERRIDE unfortunately is not supported ;) Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Good to see you back, Ian. Ready to QA again :) Nice work everyone! Pushed to master for 20.05 Pushed to 19.11.x branch for 19.11.03 backported to 19.05.x for 19.05.08 Enhancement will not be backported to 18.11.x series. |