Skip to content

Commit 5ee4133

Browse files
julianbrostyhabteab
authored andcommitted
Make sure log file is reopened when ApiListener::ReplayLog() returns
1 parent 50bc430 commit 5ee4133

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/remote/apilistener.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1463,12 +1463,14 @@ void ApiListener::ReplayLog(const JsonRpcConnection::Ptr& client)
14631463
std::unique_lock<std::mutex> lock(m_LogLock);
14641464

14651465
CloseLogFile();
1466+
Defer reopenLog;
14661467

14671468
if (count == -1 || count > 50000) {
14681469
OpenLogFile();
14691470
lock.unlock();
14701471
} else {
14711472
last_sync = true;
1473+
reopenLog.SetFunc([this]() { OpenLogFile(); });
14721474
}
14731475

14741476
count = 0;
@@ -1579,8 +1581,6 @@ void ApiListener::ReplayLog(const JsonRpcConnection::Ptr& client)
15791581
}
15801582

15811583
if (last_sync) {
1582-
OpenLogFile();
1583-
15841584
return;
15851585
}
15861586
}

0 commit comments

Comments
 (0)