Bugzilla – Attachment 32454 Details for
Bug 12995
script update_totalissues.pl stops on corrupted record
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Signed off patch
0001-SIGNED-OFF-Bug-12995-script-update_totalissues.pl-st.patch (text/plain), 2.12 KB, created by
Cindy Murdock Ames
on 2014-10-16 17:13:13 UTC
(
hide
)
Description:
Signed off patch
Filename:
MIME Type:
Creator:
Cindy Murdock Ames
Created:
2014-10-16 17:13:13 UTC
Size:
2.12 KB
patch
obsolete
>From b745c05156b24c278c97f3c4a56b7c0c131463c4 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Thu, 25 Sep 2014 15:29:35 +0200 >Subject: [PATCH] [SIGNED-OFF] Bug 12995 - script update_totalissues.pl stops > on corrupted record > >When running update_totalissues.pl cronjob, it will stop on a corrupted record. > >This patch adds eval around record modification method call, alerts if error and process next record. > >Test plan : >- Create a dabase with a few biblios and some issues >- Modify first biblio record (use direct sql update) : set a wrong value in biblioitems.marcxml >- Lauch script : misc/cronjobs/update_totalissues.pl --use-stats --commit=1000 -v >=> Without patch : the script stops at first record >=> With patch : the script prints error for first record and processes all records > >Signed-off-by: Cindy Murdock Ames <cmurdock@ccfls.org> >--- > misc/cronjobs/update_totalissues.pl | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > >diff --git a/misc/cronjobs/update_totalissues.pl b/misc/cronjobs/update_totalissues.pl >index 71da3aa..168efc4 100755 >--- a/misc/cronjobs/update_totalissues.pl >+++ b/misc/cronjobs/update_totalissues.pl >@@ -169,12 +169,16 @@ sub process_query { > print "Processing bib $biblionumber ($totalissues issues)\n" > if $verbose; > if ( not $test_only ) { >- if ( $incremental && $totalissues > 0 ) { >- UpdateTotalIssues( $biblionumber, $totalissues ); >- } >- else { >- UpdateTotalIssues( $biblionumber, 0, $totalissues ); >- } >+ eval { >+ if ( $incremental && $totalissues > 0 ) >+ { >+ UpdateTotalIssues( $biblionumber, $totalissues ); >+ } >+ else { >+ UpdateTotalIssues( $biblionumber, 0, $totalissues ); >+ } >+ }; >+ print "Unable to edit bib $biblionumber : $@\n" if ( $verbose && $@ ); > } > if ( not $test_only and ( $num_bibs_processed % $commit ) == 0 ) { > print_progress_and_commit($num_bibs_processed); >-- >1.7.10.4 >
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 12995
:
31875
|
32454
|
32534
|
32535
|
32536
|
32629
|
32630
|
32654
|
32695
|
32696