From 02334c5f29477d9a6926851ce304df07c251c586 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 e5530515b..401ccb63e 100644 --- a/lib/remote/apilistener.cpp +++ b/lib/remote/apilistener.cpp @@ -1463,12 +1463,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; @@ -1574,8 +1576,6 @@ void ApiListener::ReplayLog(const JsonRpcConnection::Ptr& client) } if (last_sync) { - OpenLogFile(); - return; } }