put back zma
This commit is contained in:
parent
752990bb0f
commit
bf6312a8ec
|
@ -55,6 +55,7 @@ use constant START_DELAY => 30; # To give everything else time to start
|
|||
|
||||
@EXTRA_PERL_LIB@
|
||||
use ZoneMinder;
|
||||
use ZoneMinder::Storage;
|
||||
use POSIX;
|
||||
use DBI;
|
||||
use autouse 'Data::Dumper'=>qw(Dumper);
|
||||
|
@ -175,6 +176,14 @@ while( 1 ) {
|
|||
# Prevent open handles building up if we have connect to shared memory
|
||||
zmMemInvalidate( $monitor ); # Close our file handle to the zmc process we are about to end
|
||||
} # end foreach monitor
|
||||
my $diskspace_sql = 'UPDATE Storage SET DiskSpace =(SELECT SUM(DiskSpace) FROM Events WHERE StorageId=? AND DiskSpace IS NOT NULL)';
|
||||
my $diskspace_sth = $dbh->prepare_cached( $sql )
|
||||
or Fatal( "Can't prepare '$sql': ".$dbh->errstr() );
|
||||
foreach my $Storage ( ZoneMinder::Storage->find() ) {
|
||||
Error("Updating disk space for $$Storage{Name}");
|
||||
$diskspace_sth->execute( $$Storage{Id} ) or Error( "Can't execute: ".$diskspace_sth->errstr() );
|
||||
}
|
||||
$diskspace_sth->finish();
|
||||
sleep( $Config{ZM_WATCH_CHECK_INTERVAL} );
|
||||
} # end while (1)
|
||||
|
||||
|
|
Loading…
Reference in New Issue