Bugzilla – Attachment 150503 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) Commit background job to the DB
Bug-32250-follow-up-Commit-background-job-to-the-D.patch (text/plain), 1.67 KB, created by
Jonathan Druart
on 2023-05-02 08:11:04 UTC
(
hide
)
Description:
Bug 32250: (follow-up) Commit background job to the DB
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-05-02 08:11:04 UTC
Size:
1.67 KB
patch
obsolete
>From f1684b68a439d7874d6e0fe7f05fc83fe70c81f7 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 20 Apr 2023 15:53:10 +0000 >Subject: [PATCH] Bug 32250: (follow-up) Commit background job to the DB > >We can't run a background job if it isn't in the database, however, >this script runs with AutoCommit disabled. We need to enable it while >generating the background job, then disable for the updates. > >I don't nkow if using a transaction would be preferable. > >I tried to solve this independently, but it requires consolidating the >index requests to make this work easily > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > misc/link_bibs_to_authorities.pl | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/misc/link_bibs_to_authorities.pl b/misc/link_bibs_to_authorities.pl >index 87b8c9feeba..c80c469dd76 100755 >--- a/misc/link_bibs_to_authorities.pl >+++ b/misc/link_bibs_to_authorities.pl >@@ -111,8 +111,9 @@ sub process_bibs { > } > > if ( not $test_only ) { >- $indexer->index_records( \@updated_biblios, "specialUpdate", "biblioserver" ); > $dbh->commit; >+ $dbh->{AutoCommit} = 1; >+ $indexer->index_records( \@updated_biblios, "specialUpdate", "biblioserver" ); > } > > my $headings_linked = 0; >@@ -248,7 +249,9 @@ sub process_bib { > sub print_progress_and_commit { > my $recs = shift; > $dbh->commit(); >+ $dbh->{AutoCommit} = 1; > $indexer->index_records( \@updated_biblios, "specialUpdate", "biblioserver" ); >+ $dbh->{AutoCommit} = 0; > @updated_biblios = (); > print "... processed $recs records\n"; > } >-- >2.25.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 32250
:
145305
|
145319
|
149969
|
150100
|
150101
|
150102
|
150239
|
150293
|
150501
|
150502
| 150503 |
150504