From 9222a63ff72d9ac6622fca862fefdf5f5f3c594c Mon Sep 17 00:00:00 2001 From: Julian Brost Date: Tue, 13 Feb 2024 09:33:47 +0100 Subject: [PATCH] Make sure log file is reopened when `ApiListener::ReplayLog()` returns --- lib/remote/apilistener.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/remote/apilistener.cpp b/lib/remote/apilistener.cpp index 94e3bd122..c9908446e 100644 --- a/lib/remote/apilistener.cpp +++ b/lib/remote/apilistener.cpp @@ -1466,12 +1466,14 @@ void ApiListener::ReplayLog(const JsonRpcConnection::Ptr& client) std::unique_lock lock(m_LogLock); CloseLogFile(); + Defer reopenLog; if (count == -1 || count > 50000) { OpenLogFile(); lock.unlock(); } else { last_sync = true; + reopenLog.SetFunc([this]() { OpenLogFile(); }); } count = 0; @@ -1577,8 +1579,6 @@ void ApiListener::ReplayLog(const JsonRpcConnection::Ptr& client) } if (last_sync) { - OpenLogFile(); - return; } }