View | Details | Raw Unified | Return to bug 32250
Collapse All | Expand All

(-)a/misc/link_bibs_to_authorities.pl (-8 / +6 lines)
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-89 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();
87
88
88
exit 0;
89
exit 0;
89
90
Lines 111-118 sub process_bibs { Link Here
111
    }
112
    }
112
113
113
    if ( not $test_only ) {
114
    if ( not $test_only ) {
114
        $dbh->commit;
115
        $schema->txn_commit;
115
        $dbh->{AutoCommit} = 1;
116
        $indexer->index_records( \@updated_biblios, "specialUpdate", "biblioserver" );
116
        $indexer->index_records( \@updated_biblios, "specialUpdate", "biblioserver" );
117
    }
117
    }
118
118
Lines 248-258 sub process_bib { Link Here
248
248
249
sub print_progress_and_commit {
249
sub print_progress_and_commit {
250
    my $recs = shift;
250
    my $recs = shift;
251
    $dbh->commit();
251
    $schema->txn_commit();
252
    $dbh->{AutoCommit} = 1;
253
    $indexer->index_records( \@updated_biblios, "specialUpdate", "biblioserver" );
252
    $indexer->index_records( \@updated_biblios, "specialUpdate", "biblioserver" );
254
    $dbh->{AutoCommit} = 0;
255
    @updated_biblios = ();
253
    @updated_biblios = ();
254
    $schema->txn_begin();
256
    print "... processed $recs records\n";
255
    print "... processed $recs records\n";
257
}
256
}
258
257
259
- 

Return to bug 32250