ad timer to update tool 60min max / 30min per Step
This commit is contained in:
@@ -151,12 +151,34 @@ bool Command::execute(QString workingDirectory, QStringList args) {
|
||||
// qDebug() << "PROCESS" << m_command << "STARTED IN" << p->workingDirectory();
|
||||
if (p->state() == QProcess::ProcessState::Running) {
|
||||
// qDebug() << "PROCESS" << m_command << "RUNNING IN" << p->workingDirectory();
|
||||
// wait forever for git/opkg-commands to finish
|
||||
// wait forever for git/opkg-commands to finish ------------------- wait for 30 min max!
|
||||
int wait = m_waitForFinishTimeout;
|
||||
if (m_command.trimmed().startsWith("git", Qt::CaseInsensitive) ||
|
||||
m_command.trimmed().startsWith("opkg", Qt::CaseInsensitive)) {
|
||||
wait = -1;
|
||||
wait = 30 * 60 * 1000;
|
||||
}
|
||||
|
||||
if (!p->waitForFinished(wait)) {
|
||||
qCritical() << "PROCESS TIMEOUT:" << m_command;
|
||||
|
||||
p->terminate();
|
||||
|
||||
if (!p->waitForFinished(5000)) {
|
||||
qCritical() << "Process did not terminate, killing:"
|
||||
<< m_command;
|
||||
|
||||
p->kill();
|
||||
|
||||
if (!p->waitForFinished(5000)) {
|
||||
qCritical() << "ERROR: Process still did not finish after kill:"
|
||||
<< m_command;
|
||||
}
|
||||
}
|
||||
|
||||
m_exitCode = -1;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool const no_timeout = p->waitForFinished(wait);
|
||||
if (no_timeout) {
|
||||
// qDebug() << "PROCESS" << m_command << "FINISHED IN" << p->workingDirectory();
|
||||
|
||||
Reference in New Issue
Block a user