add function
This commit is contained in:
@@ -344,18 +344,32 @@ void Front::OnTimerThread()
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||
std::cout << "OnTimerThread::run() is called ...... \n";
|
||||
|
||||
int counter = 0;
|
||||
int hbCounter = 0; // 心跳计数
|
||||
int backupCounter = 0; // 备份计数(分钟用)
|
||||
|
||||
send_heartbeat_to_queue("1");
|
||||
|
||||
while (!m_IsTimerCancel)
|
||||
{
|
||||
update_log_entries_countdown();
|
||||
|
||||
if (counter >= 30) {
|
||||
//业务超时检查
|
||||
check_device_busy_timeout();
|
||||
|
||||
// 每 30 秒发一次心跳
|
||||
if (hbCounter >= 30) {
|
||||
send_heartbeat_to_queue("1");
|
||||
counter = 0;
|
||||
hbCounter = 0;
|
||||
}
|
||||
counter++;
|
||||
|
||||
// 每 60 秒调用一次录波文件检查
|
||||
if (backupCounter >= 60) {
|
||||
check_and_backup_qvvr_files();
|
||||
backupCounter = 0;
|
||||
}
|
||||
|
||||
hbCounter++;
|
||||
backupCounter++;
|
||||
|
||||
g_ontime_blocked_times = 0;
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||
@@ -366,7 +380,6 @@ void Front::OnTimerThread()
|
||||
std::cerr << "[OnTimerThread] Caught unknown exception" << std::endl;
|
||||
}
|
||||
|
||||
// 设置重启标志
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_threadCheckMutex);
|
||||
m_needRestartTimerThread = true;
|
||||
|
||||
Reference in New Issue
Block a user