#1474 : Bulkmarcimport croaks when Log is ON
authorPaul POULAIN <paul@koha-fr.org>
Thu, 11 Oct 2007 19:52:56 +0000 (14:52 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Thu, 11 Oct 2007 19:53:59 +0000 (14:53 -0500)
set to 0 and restore at the end of the import

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
misc/migration_tools/bulkmarcimport.pl

index 85e6b25..b13dde8 100755 (executable)
@@ -180,6 +180,11 @@ exit;
 
 my $dbh = C4::Context->dbh;
 
+# save the CataloguingLog property : 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'");
+
 if ($delete) {
     print "deleting biblios\n";
     $dbh->do("truncate biblio");
@@ -305,5 +310,8 @@ if ($fk_off) {
 #z3950_extended_services('commit',set_service_options('commit'));
 #print "COMMIT OPERATION SUCCESSFUL\n";
 
+# restore CataloguingLog
+$dbh->do("UPDATE systempreferences SET value=$CataloguingLog WHERE variable='CataloguingLog'");
+
 my $timeneeded = gettimeofday - $starttime;
 print "$i MARC records done in $timeneeded seconds\n";