Bugzilla – Attachment 150239 Details for
Bug 32250
link_bibs_to_authorities generates too many background jobs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32250: (follow-up) Remove use of AutoCommit=0
Bug-32250-follow-up-Remove-use-of-AutoCommit0.patch (text/plain), 1.86 KB, created by
Nick Clemens (kidclamp)
on 2023-04-26 12:51:04 UTC
(
hide
)
Description:
Bug 32250: (follow-up) Remove use of AutoCommit=0
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-04-26 12:51:04 UTC
Size:
1.86 KB
patch
obsolete
>From 86e70394f2957c8b50c95fa908404689424fc169 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 26 Apr 2023 12:50:03 +0000 >Subject: [PATCH] Bug 32250: (follow-up) Remove use of AutoCommit=0 > >This patch moves to using txn_begin and txn_commit >--- > misc/link_bibs_to_authorities.pl | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) > >diff --git a/misc/link_bibs_to_authorities.pl b/misc/link_bibs_to_authorities.pl >index c80c469dd7..54f5716626 100755 >--- a/misc/link_bibs_to_authorities.pl >+++ b/misc/link_bibs_to_authorities.pl >@@ -17,6 +17,7 @@ use Time::HiRes qw( time ); > use POSIX qw( ceil strftime ); > use Module::Load::Conditional qw( can_load ); > >+use Koha::Database; > use Koha::SearchEngine; > use Koha::SearchEngine::Indexer; > >@@ -81,7 +82,8 @@ my $dbh = C4::Context->dbh; > my @updated_biblios = (); > my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); > >-$dbh->{AutoCommit} = 0; >+my $schema = Koha::Database->schema; >+$schema->txn_begin; > process_bibs( $linker, $bib_limit, $auth_limit, $commit, { tagtolink => $tagtolink, allowrelink => $allowrelink }); > $dbh->commit(); > >@@ -111,9 +113,9 @@ sub process_bibs { > } > > if ( not $test_only ) { >- $dbh->commit; >- $dbh->{AutoCommit} = 1; >+ $schema->txn_commit; > $indexer->index_records( \@updated_biblios, "specialUpdate", "biblioserver" ); >+ $schema->txn_begin; > } > > my $headings_linked = 0; >@@ -248,11 +250,10 @@ sub process_bib { > > sub print_progress_and_commit { > my $recs = shift; >- $dbh->commit(); >- $dbh->{AutoCommit} = 1; >+ $schema->txn_commit(); > $indexer->index_records( \@updated_biblios, "specialUpdate", "biblioserver" ); >- $dbh->{AutoCommit} = 0; > @updated_biblios = (); >+ $schema->txn_begin(); > print "... processed $recs records\n"; > } > >-- >2.30.2
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 32250
:
145305
|
145319
|
149969
|
150100
|
150101
|
150102
|
150239
|
150293
|
150501
|
150502
|
150503
|
150504