mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-24 22:24:44 +02:00
Make sure log file is reopened when ApiListener::ReplayLog()
returns
This commit is contained in:
parent
b0b41b1aff
commit
02334c5f29
@ -1463,12 +1463,14 @@ void ApiListener::ReplayLog(const JsonRpcConnection::Ptr& client)
|
||||
std::unique_lock<std::mutex> lock(m_LogLock);
|
||||
|
||||
CloseLogFile();
|
||||
Defer reopenLog;
|
||||
|
||||
if (count == -1 || count > 50000) {
|
||||
OpenLogFile();
|
||||
lock.unlock();
|
||||
} else {
|
||||
last_sync = true;
|
||||
reopenLog.SetFunc([this]() { OpenLogFile(); });
|
||||
}
|
||||
|
||||
count = 0;
|
||||
@ -1574,8 +1576,6 @@ void ApiListener::ReplayLog(const JsonRpcConnection::Ptr& client)
|
||||
}
|
||||
|
||||
if (last_sync) {
|
||||
OpenLogFile();
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user