made concurent task fail

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2023-07-14 21:07:53 +03:00
parent 7f4665e3cc
commit d3dc00dcab
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318
2 changed files with 10 additions and 11 deletions

View File

@ -112,7 +112,6 @@ void Flame::FileResolvingTask::netJobFinished()
connect(m_checkJob.get(), &NetJob::failed, this, [this, step_progress](QString reason) {
step_progress->state = TaskStepState::Failed;
stepProgress(*step_progress);
emitFailed(reason);
});
connect(m_checkJob.get(), &NetJob::stepProgress, this, &FileResolvingTask::propogateStepProgress);
connect(m_checkJob.get(), &NetJob::progress, this, [this, step_progress](qint64 current, qint64 total) {

View File

@ -118,8 +118,11 @@ void ConcurrentTask::startNext()
if (m_aborted || m_doing.count() > m_total_max_size)
return;
if (m_queue.isEmpty() && m_doing.isEmpty() && !wasSuccessful()) {
if (m_queue.isEmpty() && m_doing.isEmpty() && isRunning()) {
if (m_failed.isEmpty())
emitSucceeded();
else
emitFailed(tr("One or more subtasks failed"));
return;
}
@ -254,12 +257,10 @@ void ConcurrentTask::subTaskStepProgress(Task::Ptr task, TaskStepProgress const&
emit stepProgress(*tp.get());
updateStepProgress(*tp.get(), op);
}
}
void ConcurrentTask::updateStepProgress(TaskStepProgress const& changed_progress, Operation op)
{
switch (op) {
case Operation::ADDED:
m_stepProgress += changed_progress.current;
@ -276,7 +277,6 @@ void ConcurrentTask::updateStepProgress(TaskStepProgress const& changed_progress
m_stepTotalProgress += changed_progress.total;
break;
}
}
void ConcurrentTask::updateState()