From f9e5f01434c96d5cf7a6c866c5a8bd51787ab939 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sun, 30 Jan 2011 17:47:25 +0100 Subject: [PATCH] make check_archive transactionally safe --- bin/BackupPC_ASA_PostArchive_Update | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/BackupPC_ASA_PostArchive_Update b/bin/BackupPC_ASA_PostArchive_Update index 93478c9..e3d022d 100755 --- a/bin/BackupPC_ASA_PostArchive_Update +++ b/bin/BackupPC_ASA_PostArchive_Update @@ -230,7 +230,6 @@ sub check_archive { }); $sth_insert->execute($backup_id, $part_nr, $tar_size, $size, $md5, $items, $filename); - $dbh->commit; } print " [parts: ",join(", ", @tar_parts),"]" if $opt->debug; @@ -322,7 +321,6 @@ sub check_archive { $part_nr, get_backup_id($host, $num), ); - $dbh->commit; @tar_files = sort @tar_files; print "\n\t",($#tar_files + 1), " tar files"; @@ -366,6 +364,8 @@ sub check_archive { print " ",($same ? 'ok' : 'DIFFERENT'), ", dur: ",fmt_time(time() - $t), "\n"; + $dbh->commit; + return $same; } @@ -446,8 +446,6 @@ while (my $row = $sth->fetchrow_hashref) { print ", dur: ",fmt_time(time() - $t), "\n"; - $dbh->commit; - } undef $sth; -- 2.20.1