Bugzilla – Attachment 97143 Details for
Bug 23377
bulkmarcimport.pl disables syspref caching
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23377: use ENV syspref override instead of complete disable
Bug-23377-use-ENV-syspref-override-instead-of-comp.patch (text/plain), 2.84 KB, created by
Michal Denar
on 2020-01-09 22:07:59 UTC
(
hide
)
Description:
Bug 23377: use ENV syspref override instead of complete disable
Filename:
MIME Type:
Creator:
Michal Denar
Created:
2020-01-09 22:07:59 UTC
Size:
2.84 KB
patch
obsolete
>From 1069a18cfdc8a5f0447e24c40d2ec7a6247eac2b Mon Sep 17 00:00:00 2001 >From: Ian Walls <ian@bywatersolutions.com> >Date: Wed, 31 Jul 2019 16:32:23 +0000 >Subject: [PATCH] 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> >--- > misc/migration_tools/bulkmarcimport.pl | 18 +++++------------- > 1 file changed, 5 insertions(+), 13 deletions(-) > >diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl >index bc438aac38..a7a4ca10f4 100755 >--- a/misc/migration_tools/bulkmarcimport.pl >+++ b/misc/migration_tools/bulkmarcimport.pl >@@ -159,15 +159,8 @@ if ((not defined $sourcesubfield) && (not defined $sourcetag)){ > > # Disable logging for the biblios and authorities import operation. It would unnecessarily > # slow the import >- >-# Disable the syspref cache so we can change logging settings >-C4::Context->disable_syspref_cache(); >-# Save current CataloguingLog and AuthoritiesLog sysprefs values >-my $CataloguingLog = C4::Context->preference( 'CataloguingLog' ); >-my $AuthoritiesLog = C4::Context->preference( 'AuthoritiesLog' ); >-# Disable logging for both >-C4::Context->set_preference( 'CataloguingLog', 0 ); >-C4::Context->set_preference( 'AuthoritiesLog', 0 ); >+$ENV{SYSPREF_OVERRIDE_CataloguingLog} = 0; >+$ENV{SYSPREF_OVERRIDE_AuthoritiesLog} = 0; > > if ($fk_off) { > $dbh->do("SET FOREIGN_KEY_CHECKS = 0"); >@@ -564,10 +557,9 @@ if ($fk_off) { > $dbh->do("SET FOREIGN_KEY_CHECKS = 1"); > } > >-# Restore CataloguingLog >-C4::Context->set_preference( 'CataloguingLog', $CataloguingLog ); >-# Restore AuthoritiesLog >-C4::Context->set_preference( 'AuthoritiesLog', $AuthoritiesLog ); >+# Restore CataloguingLog and AuthoritiesLog >+delete $ENV{SYSPREF_OVERRIDE_CataloguingLog}; >+delete $ENV{SYSPREF_OVERRIDE_AuthoritiesLog}; > > my $timeneeded = gettimeofday - $starttime; > print "\n$i MARC records done in $timeneeded seconds\n"; >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23377
:
91898
|
97143
|
97183
|
97184