Skip to content
Snippets Groups Projects
Commit eae78c5d authored by Jonas Petersson's avatar Jonas Petersson
Browse files

add back the removal of the threads

parent 49ecd176
1 merge request!895add back the removal of the threads
Pipeline #213164 passed
......@@ -176,11 +176,11 @@ void Topic::createStreams(
}
void Topic::checkIfDone() {
auto const is_done =
std::all_of(ConsumerThreads.begin(), ConsumerThreads.end(),
[](auto const &thread) { return thread->has_finished(); });
if (is_done) {
Logger::Info("Topic {} has finished consuming.", TopicName);
ConsumerThreads.erase(
std::remove_if(ConsumerThreads.begin(), ConsumerThreads.end(),
[](auto const &Elem) { return Elem->has_finished(); }),
ConsumerThreads.end());
if (ConsumerThreads.empty()) {
IsDone.store(true);
}
std::this_thread::sleep_for(50ms);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment