If mysql gets restarted, and there is no change in fps, then the monitor_status record never gets updated. So just always update it.

This commit is contained in:
Isaac Connor 2018-07-31 12:07:57 -04:00
parent 588ca2cf62
commit 639717eb7b
1 changed files with 11 additions and 13 deletions

View File

@ -2474,9 +2474,7 @@ int Monitor::Capture() {
//Info( "%d -> %d -> %lf -> %lf", now-last_fps_time, fps_report_interval/(now-last_fps_time), double(fps_report_interval)/(now-last_fps_time), fps );
Info("%s: images:%d - Capturing at %.2lf fps, capturing bandwidth %ubytes/sec", name, image_count, new_fps, new_capture_bandwidth);
last_fps_time = now;
if ( new_fps != fps ) {
fps = new_fps;
db_mutex.lock();
static char sql[ZM_SQL_SML_BUFSIZ];
snprintf(sql, sizeof(sql),
@ -2486,7 +2484,7 @@ int Monitor::Capture() {
Error("Can't run query: %s", mysql_error(&dbconn));
}
db_mutex.unlock();
} // end if new_fps != fps
Debug(4,sql);
} // end if time has changed since last update
} // end if it might be time to report the fps
} // end if captureResult