Bugzilla – Attachment 30550 Details for
Bug 12720
Turn off Authority logging when running "bulkmarcimport.pl"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12720 - Turn off Authority logging when running "bulkmarcimport.pl"
Bug-12720---Turn-off-Authority-logging-when-runnin.patch (text/plain), 2.53 KB, created by
David Cook
on 2014-08-06 05:29:02 UTC
(
hide
)
Description:
Bug 12720 - Turn off Authority logging when running "bulkmarcimport.pl"
Filename:
MIME Type:
Creator:
David Cook
Created:
2014-08-06 05:29:02 UTC
Size:
2.53 KB
patch
obsolete
>From f195d5f74eaa281220b761bdd5fda38b1b927a70 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Wed, 6 Aug 2014 15:25:17 +1000 >Subject: [PATCH] Bug 12720 - Turn off Authority logging when running > "bulkmarcimport.pl" > >This patch turns off the AuthoritiesLogging syspref when running the >bulkmarcimport.pl script. > >It also temporarily disables the syspref caching which will have >been making the CataloguingLogging handling ineffectual. (That is, >updating the CataloguingLogging syspref in the script wouldn't >have an effect as the original cached value would be used anyway.) > >_TEST PLAN_ > >0) Turn on "AuthoritiesLogging" syspref >1) Load an authority record using bulkmarcimport.pl >2) Note a new Authorities entry in action_logs > >3) Apply the patch > >4) Repeat Step 1 >5) Note that no new entry is made in action_logs > >(Bonus points: Do the same thing with CataloguingLogging and a >bibliographic record.) >--- > misc/migration_tools/bulkmarcimport.pl | 10 +++++++++- > 1 files changed, 9 insertions(+), 1 deletions(-) > >diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl >index 4a47de0..6acca56 100755 >--- a/misc/migration_tools/bulkmarcimport.pl >+++ b/misc/migration_tools/bulkmarcimport.pl >@@ -121,11 +121,17 @@ if ((not defined $sourcesubfield) && (not defined $sourcetag)){ > $sourcesubfield="a"; > } > >-# save the CataloguingLog property : we don't want to log a bulkmarcimport. It will slow the import & >+#Disable the syspref cache or else the following UPDATE statements will have no effectq >+C4::Context->disable_syspref_cache(); >+ >+# save the CataloguingLog and AuthoritiesLog properties : we don't want to log a bulkmarcimport. It will slow the import & > # will create problems in the action_logs table, that can't handle more than 1 entry per second per user. > my $CataloguingLog = C4::Context->preference('CataloguingLog'); > $dbh->do("UPDATE systempreferences SET value=0 WHERE variable='CataloguingLog'"); > >+my $AuthoritiesLog = C4::Context->preference('AuthoritiesLog'); >+$dbh->do("UPDATE systempreferences SET value=0 WHERE variable='AuthoritiesLog'"); >+ > if ($fk_off) { > $dbh->do("SET FOREIGN_KEY_CHECKS = 0"); > } >@@ -496,6 +502,8 @@ if ($fk_off) { > > # restore CataloguingLog > $dbh->do("UPDATE systempreferences SET value=$CataloguingLog WHERE variable='CataloguingLog'"); >+# restore AuthoritiesLog >+$dbh->do("UPDATE systempreferences SET value=$AuthoritiesLog WHERE variable='AuthoritiesLog'"); > > my $timeneeded = gettimeofday - $starttime; > print "\n$i MARC records done in $timeneeded seconds\n"; >-- >1.7.7.4
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 12720
:
30550
|
30560
|
30956
|
31127