Bugzilla – Attachment 157738 Details for
Bug 35141
Prevent link_bibs_to_authorities from dying on search error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35141: Catch ES search exceptions in link_bibs_to_authorities, warn, and continue
Bug-35141-Catch-ES-search-exceptions-in-linkbibsto.patch (text/plain), 1.74 KB, created by
Nick Clemens (kidclamp)
on 2023-10-24 12:04:11 UTC
(
hide
)
Description:
Bug 35141: Catch ES search exceptions in link_bibs_to_authorities, warn, and continue
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-10-24 12:04:11 UTC
Size:
1.74 KB
patch
obsolete
>From 1a1f3a82515d163d3d5d1795d2f89ad7debfbcc5 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 24 Oct 2023 11:51:29 +0000 >Subject: [PATCH] Bug 35141: Catch ES search exceptions in > link_bibs_to_authorities, warn, and continue > >This patch simplay adds an eval and a warning to link_bibs_to_authorities to catch any errors while searching and continue linking. > >To test: >1 - edit /etc/kohia/sites/kohadev/koha-conf.xml and add to elasticsearch stanza > <request_timeout>0</request_timeout> >2 - perl misc/link_bibs_to_authorities.pl >3 - It dies immediately >4 - Apply patch >5 - perl misc/link_bibs_to_authorities.pl >6 - Now it tries every record, throwing warnings along the way, but completes >--- > misc/link_bibs_to_authorities.pl | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) > >diff --git a/misc/link_bibs_to_authorities.pl b/misc/link_bibs_to_authorities.pl >index f7cd876d26..08550c76c0 100755 >--- a/misc/link_bibs_to_authorities.pl >+++ b/misc/link_bibs_to_authorities.pl >@@ -211,8 +211,17 @@ sub process_bib { > > my $frameworkcode = GetFrameworkCode($biblionumber); > >- my ( $headings_changed, $results ) = >- LinkBibHeadingsToAuthorities( $linker, $record, $frameworkcode, $allowrelink, $tagtolink ); >+ my ( $headings_changed, $results ); >+ >+ eval { >+ ( $headings_changed, $results ) = >+ LinkBibHeadingsToAuthorities( $linker, $record, $frameworkcode, $allowrelink, $tagtolink ); >+ }; >+ if ($@) { >+ warn "Error while searching for authorities for biblionumber $biblionumber at " . localtime(time); >+ return; >+ } >+ > foreach my $key ( keys %{ $results->{'unlinked'} } ) { > $unlinked_headings{$key} += $results->{'unlinked'}->{$key}; > } >-- >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 35141
:
157738
|
157739
|
157766
|
157767
|
157972
|
157973
|
157974