From 4122ae99a5ecf552c9d4f3b0a5d96bed4cc53eb2 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 28 Oct 2021 12:03:58 -0400 Subject: [PATCH] add a comment about rollbacks --- scripts/ZoneMinder/lib/ZoneMinder/Event.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Event.pm b/scripts/ZoneMinder/lib/ZoneMinder/Event.pm index b740481eb..5f11b1ada 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Event.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Event.pm @@ -744,11 +744,11 @@ sub MoveTo { $$self{StorageId} = $$NewStorage{Id}; $self->Storage($NewStorage); $error .= $self->save(); - if ($error) { - $ZoneMinder::Database::dbh->commit() if !$was_in_transaction; - return $error; - } + + # Going to leave it to upper layout as to whether we rollback or not $ZoneMinder::Database::dbh->commit() if !$was_in_transaction; + return $error if $error; + $self->delete_files($OldStorage); return $error; } # end sub MoveTo