Added logging for copies/moves to zmfilter.pl

This commit is contained in:
Brandon Thetford 2021-02-10 15:31:10 -07:00
parent b64bd97a64
commit a7eab75cf9
1 changed files with 2 additions and 0 deletions

View File

@ -346,6 +346,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 $_;
}
@ -354,6 +355,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();