Check if download/reporting thread are running

This commit is contained in:
Gerhard Hoffmann 2024-02-29 11:30:24 +01:00
parent 9b087f62f9
commit 052028afe8

View File

@ -655,9 +655,14 @@ bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
QThread::sleep(2); QThread::sleep(2);
if (!m_hw->dcDownloadRunning()) { // may take some time int tries = 5;
qCritical() << QDateTime::currentDateTime().toString(Qt::ISODate) while (!m_hw->dcDownloadRunning()) { // may take some time
<< "(" << __func__ << ":" << __LINE__ << ") DOWNLOAD NOT RUNNING"; if (--tries < 0) {
qCritical() << QDateTime::currentDateTime().toString(Qt::ISODate)
<< "(" << __func__ << ":" << __LINE__ << ") DOWNLOAD NOT RUNNING";
break;
}
QThread::sleep(1);
continue; continue;
} }
@ -666,9 +671,13 @@ bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
QThread::sleep(2); QThread::sleep(2);
if (!m_hw->dcDownloadReportThreadStart()) { // may take some time tries = 5;
qCritical() << QDateTime::currentDateTime().toString(Qt::ISODate) while (!m_hw->dcDownloadReportThreadStart()) { // may take some time
<< "(" << __func__ << ":" << __LINE__ << ") REPORT THREAD NOT STARTED"; if (--tries < 0) {
qCritical() << QDateTime::currentDateTime().toString(Qt::ISODate)
<< "(" << __func__ << ":" << __LINE__ << ") REPORT THREAD NOT STARTED";
break;
}
continue; continue;
} }
@ -676,18 +685,29 @@ bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
<< "(" << __func__ << ":" << __LINE__ << ") REPORT THREAD STARTED"; << "(" << __func__ << ":" << __LINE__ << ") REPORT THREAD STARTED";
QThread::sleep(2); QThread::sleep(2);
if (!m_hw->dcDownloadReportRunning()) { // may take some time
qCritical() << QDateTime::currentDateTime().toString(Qt::ISODate) tries = 5;
<< "(" << __func__ << ":" << __LINE__ << ") DOWNLOAD REPORT NOT RUNNING"; while (!m_hw->dcDownloadReportRunning()) { // may take some time
if (--tries < 0) {
qCritical() << QDateTime::currentDateTime().toString(Qt::ISODate)
<< "(" << __func__ << ":" << __LINE__ << ") DOWNLOAD REPORT NOT RUNNING";
break;
}
continue; continue;
} }
qCritical() << QDateTime::currentDateTime().toString(Qt::ISODate) qCritical() << QDateTime::currentDateTime().toString(Qt::ISODate)
<< "(" << __func__ << ":" << __LINE__ << ") DOWNLOAD REPORT RUNNING"; << "(" << __func__ << ":" << __LINE__ << ") DOWNLOAD REPORT RUNNING";
tries = 1200;
while (m_hw->dcDownloadReportRunning()) { while (m_hw->dcDownloadReportRunning()) {
QThread::msleep(500); QThread::msleep(1000);
if (--tries < 0) {
qCritical() << QDateTime::currentDateTime().toString(Qt::ISODate)
<< "(" << __func__ << ":" << __LINE__
<< ") DOWNLOAD REPORT STILL RUNNING AFTER 20mins";
break;
}
} }
bool updateBinaryRes = true; bool updateBinaryRes = true;