Merge pull request #3156 from dodexahedron/3155-log-copies-and-moves

Added logging for copies/moves to zmfilter.pl
This commit is contained in:
Isaac Connor 2021-02-10 17:35:06 -05:00 committed by GitHub
commit 33cabd3621
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -360,6 +360,7 @@ sub checkFilter {
if ( $filter->{AutoMove} ) {
my $NewStorage = new ZoneMinder::Storage($filter->{AutoMoveTo});
Info("Moving event $Event->{Id} to datastore $filter->{AutoMoveTo}");
$_ = $Event->MoveTo($NewStorage);
Error($_) if $_;
}
@ -368,6 +369,7 @@ sub checkFilter {
# So we still need to update the Event object with the new SecondaryStorageId
my $NewStorage = ZoneMinder::Storage->find_one(Id=>$filter->{AutoCopyTo});
if ( $NewStorage ) {
Info("Copying event $Event->{Id} to datastore $filter->{AutoCopyTo}");
$_ = $Event->CopyTo($NewStorage);
if ( $_ ) {
$ZoneMinder::Database::dbh->commit();