Add buffer clearing to stop_saving procedure

This commit is contained in:
2020-04-08 15:16:09 +02:00
parent a6cea76fb5
commit f9b222a3e6
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -97,7 +97,7 @@ void ZmqRecvModule::start_saving()
is_saving_ = true;
}
void ZmqRecvModule::stop_saving()
void ZmqRecvModule::stop_saving_and_clear_buffer()
{
#ifdef DEBUG_OUTPUT
using namespace date;
@@ -108,6 +108,12 @@ void ZmqRecvModule::stop_saving()
#endif
is_saving_ = false;
// TODO: Solve the problem differently - control to RB?
this_thread::sleep_for(chrono::milliseconds(
config::recv_saving_wait_ms));
ring_buffer_.clear();
}
void ZmqRecvModule::receive_thread(const string& connect_address)