910/restream stop delay (#1093)

* wait a bit for post processor to process the dummy

* refactoring

* minor
This commit is contained in:
maliakal_d 2025-02-11 11:02:32 +01:00 committed by GitHub
parent 84e83bf551
commit bf82aeee8d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1177,12 +1177,21 @@ int DetectorImpl::acquire() {
if (dataReady == nullptr) {
setJoinThreadFlag(true);
} else if (receiver) {
// wait for postprocessor to process dummies
if (dataReady != nullptr) {
// process dummy from stop receier
if (numZmqRunning != 0)
std::this_thread::sleep_for(std::chrono::milliseconds(200));
while (numZmqRunning != 0) {
Parallel(&Module::restreamStopFromReceiver, {});
// increase time for fewer dummy packets to process
// time to process restream dummy
std::this_thread::sleep_for(std::chrono::milliseconds(200));
// increase time for fewer dummies and to catch up
if (numZmqRunning != 0)
std::this_thread::sleep_for(std::chrono::seconds(2));
}
}
}
dataProcessingThread.join();
if (acquisition_finished != nullptr) {