Bugzilla – Attachment 157972 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.88 KB, created by
Marcel de Rooy
on 2023-10-27 07:28:07 UTC
(
hide
)
Description:
Bug 35141: Catch ES search exceptions in link_bibs_to_authorities, warn, and continue
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-10-27 07:28:07 UTC
Size:
1.88 KB
patch
obsolete
>From b72ede5a41e1903504c4ca337cf42462c81ea16f 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 >Content-Type: text/plain; charset=utf-8 > >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 > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > 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