event may have changed (have endtime set) between load and saving Archived bit. Lock the event which now also reloads it.

This commit is contained in:
Isaac Connor 2021-08-06 19:15:22 -04:00
parent 500ced2dc5
commit 672de6e84f
1 changed files with 3 additions and 0 deletions

View File

@ -47,9 +47,12 @@ if ( $action == 'create' ) {
$monitor = new ZM\Monitor($monitor_id);
$monitor->TriggerOff();
}
$dbConn->beginTransaction();
foreach ( $snapshot->Events() as $event ) {
$event->lock();
$event->save(array('Archived'=>1));
}
$dbConn->commit();
$redirect = '?view=snapshot&id='.$snapshot->Id();
return;
}