Lines 17-22
use Time::HiRes qw( time );
Link Here
|
17 |
use POSIX qw( ceil strftime ); |
17 |
use POSIX qw( ceil strftime ); |
18 |
use Module::Load::Conditional qw( can_load ); |
18 |
use Module::Load::Conditional qw( can_load ); |
19 |
|
19 |
|
|
|
20 |
use Koha::Database; |
20 |
use Koha::SearchEngine; |
21 |
use Koha::SearchEngine; |
21 |
use Koha::SearchEngine::Indexer; |
22 |
use Koha::SearchEngine::Indexer; |
22 |
|
23 |
|
Lines 81-87
my $dbh = C4::Context->dbh;
Link Here
|
81 |
my @updated_biblios = (); |
82 |
my @updated_biblios = (); |
82 |
my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); |
83 |
my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); |
83 |
|
84 |
|
84 |
$dbh->{AutoCommit} = 0; |
85 |
my $schema = Koha::Database->schema; |
|
|
86 |
$schema->txn_begin; |
85 |
process_bibs( $linker, $bib_limit, $auth_limit, $commit, { tagtolink => $tagtolink, allowrelink => $allowrelink }); |
87 |
process_bibs( $linker, $bib_limit, $auth_limit, $commit, { tagtolink => $tagtolink, allowrelink => $allowrelink }); |
86 |
$dbh->commit(); |
88 |
$dbh->commit(); |
87 |
|
89 |
|
Lines 111-119
sub process_bibs {
Link Here
|
111 |
} |
113 |
} |
112 |
|
114 |
|
113 |
if ( not $test_only ) { |
115 |
if ( not $test_only ) { |
114 |
$dbh->commit; |
116 |
$schema->txn_commit; |
115 |
$dbh->{AutoCommit} = 1; |
|
|
116 |
$indexer->index_records( \@updated_biblios, "specialUpdate", "biblioserver" ); |
117 |
$indexer->index_records( \@updated_biblios, "specialUpdate", "biblioserver" ); |
|
|
118 |
$schema->txn_begin; |
117 |
} |
119 |
} |
118 |
|
120 |
|
119 |
my $headings_linked = 0; |
121 |
my $headings_linked = 0; |
Lines 248-258
sub process_bib {
Link Here
|
248 |
|
250 |
|
249 |
sub print_progress_and_commit { |
251 |
sub print_progress_and_commit { |
250 |
my $recs = shift; |
252 |
my $recs = shift; |
251 |
$dbh->commit(); |
253 |
$schema->txn_commit(); |
252 |
$dbh->{AutoCommit} = 1; |
|
|
253 |
$indexer->index_records( \@updated_biblios, "specialUpdate", "biblioserver" ); |
254 |
$indexer->index_records( \@updated_biblios, "specialUpdate", "biblioserver" ); |
254 |
$dbh->{AutoCommit} = 0; |
|
|
255 |
@updated_biblios = (); |
255 |
@updated_biblios = (); |
|
|
256 |
$schema->txn_begin(); |
256 |
print "... processed $recs records\n"; |
257 |
print "... processed $recs records\n"; |
257 |
} |
258 |
} |
258 |
|
259 |
|
259 |
- |
|
|