Bugzilla – Attachment 31127 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: (QA followup) use API instead of plain SQL
Bug-12720-QA-followup-use-API-instead-of-plain-SQL.patch (text/plain), 2.57 KB, created by
Tomás Cohen Arazi (tcohen)
on 2014-08-24 16:21:38 UTC
(
hide
)
Description:
Bug 12720: (QA followup) use API instead of plain SQL
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2014-08-24 16:21:38 UTC
Size:
2.57 KB
patch
obsolete
>From a6c278f8e0b214ec31428394c1e0cdc4b58cdfc0 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Sun, 24 Aug 2014 13:09:33 -0300 >Subject: [PATCH] Bug 12720: (QA followup) use API instead of plain SQL > >Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> >--- > misc/migration_tools/bulkmarcimport.pl | 26 ++++++++++++++------------ > 1 file changed, 14 insertions(+), 12 deletions(-) > >diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl >index fc5ab84..61ece6c 100755 >--- a/misc/migration_tools/bulkmarcimport.pl >+++ b/misc/migration_tools/bulkmarcimport.pl >@@ -121,16 +121,18 @@ if ((not defined $sourcesubfield) && (not defined $sourcetag)){ > $sourcesubfield="a"; > } > >-#Disable the syspref cache or else the following UPDATE statements will have no effect >-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'"); >+# Disable logging for the biblios and authorities import operation. It would unnecesarily >+# slow the import > >-my $AuthoritiesLog = C4::Context->preference('AuthoritiesLog'); >-$dbh->do("UPDATE systempreferences SET value=0 WHERE variable='AuthoritiesLog'"); >+# 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 ); > > if ($fk_off) { > $dbh->do("SET FOREIGN_KEY_CHECKS = 0"); >@@ -500,10 +502,10 @@ if ($fk_off) { > $dbh->do("SET FOREIGN_KEY_CHECKS = 1"); > } > >-# restore CataloguingLog >-$dbh->do("UPDATE systempreferences SET value=$CataloguingLog WHERE variable='CataloguingLog'"); >-# restore AuthoritiesLog >-$dbh->do("UPDATE systempreferences SET value=$AuthoritiesLog WHERE variable='AuthoritiesLog'"); >+# Restore CataloguingLog >+C4::Context->set_preference( 'CataloguingLog', $CataloguingLog ); >+# Restore AuthoritiesLog >+C4::Context->set_preference( 'AuthoritiesLog', $AuthoritiesLog ); > > my $timeneeded = gettimeofday - $starttime; > print "\n$i MARC records done in $timeneeded seconds\n"; >-- >1.9.1
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