Bugzilla – Attachment 123851 Details for
Bug 25078
Update DB process - wrap each DBRev inside a transaction and better error handling
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25078: Don't process db revs if updatedatabase.pl failed
Bug-25078-Dont-process-db-revs-if-updatedatabasepl.patch (text/plain), 2.63 KB, created by
Jonathan Druart
on 2021-08-16 09:45:39 UTC
(
hide
)
Description:
Bug 25078: Don't process db revs if updatedatabase.pl failed
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-08-16 09:45:39 UTC
Size:
2.63 KB
patch
obsolete
>From fea559ec34d1c4df2d6408758bd839986cd5442a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 16 Aug 2021 11:44:14 +0200 >Subject: [PATCH] Bug 25078: Don't process db revs if updatedatabase.pl failed > >The updatedatebase stops when something wrong happens, we should not >continue to process the new DB revs (db_revs dir) in that case. >--- > installer/install.pl | 31 +++++++++++++++++-------------- > 1 file changed, 17 insertions(+), 14 deletions(-) > >diff --git a/installer/install.pl b/installer/install.pl >index abb3897a949..cffabec3fe6 100755 >--- a/installer/install.pl >+++ b/installer/install.pl >@@ -416,10 +416,12 @@ elsif ( $step && $step == 3 ) { > or die "Cannot open log file $logfilepath_errors: $!"; > @report = <$fh>; > close $fh; >+ my $update_errors; > if (@report) { > $template->param( update_errors => > [ map { { line => $_ } } split( /\n/, join( '', @report ) ) ] > ); >+ $update_errors = 1; > $template->param( has_update_errors => 1 ); > warn > "The following errors were returned while attempting to run the updatedatabase.pl script:\n"; >@@ -429,21 +431,22 @@ elsif ( $step && $step == 3 ) { > eval { `rm $logfilepath_errors` }; > } > >- my $db_entries = get_db_entries(); >- my $report = update( $db_entries ); >- my $atomic_update_files = get_atomic_updates; >- my $atomic_update_report = run_atomic_updates( $atomic_update_files ); >- >- $template->param( >- success => $report->{success}, >- error => $report->{error}, >- atomic_updates => { >- success => $atomic_update_report->{success}, >- error => $atomic_update_report->{error} >- } >- ); >+ unless ( $update_errors ) { >+ my $db_entries = get_db_entries(); >+ my $report = update( $db_entries ); >+ my $atomic_update_files = get_atomic_updates; >+ my $atomic_update_report = run_atomic_updates( $atomic_update_files ); >+ >+ $template->param( >+ success => $report->{success}, >+ error => $report->{error}, >+ atomic_updates => { >+ success => $atomic_update_report->{success}, >+ error => $atomic_update_report->{error} >+ } >+ ); >+ } > >- #warn "The following errors were returned while attempting to run the updatedatabase.pl script:\n"; #FIXME restore this > $template->param( $op => 1 ); > } > else { >-- >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 25078
:
102521
|
116032
|
116033
|
116034
|
116208
|
116209
|
117084
|
121909
|
121910
|
121911
|
121982
|
121983
|
121984
|
122208
|
122322
|
122323
|
122324
|
122325
|
122326
|
122329
|
122665
|
122666
|
122667
|
122668
|
122669
|
122670
|
122671
|
122679
|
122680
|
122875
|
123356
|
123357
|
123358
|
123359
|
123360
|
123361
|
123362
|
123363
|
123364
|
123365
|
123366
|
123367
|
123850
| 123851 |
123853
|
123937
|
124269