| 65 | } |
| 66 | |
| 67 | void NetJob::executeNextSubTask() |
| 68 | { |
| 69 | // We're finished, check for failures and retry if we can (up to 3 times) |
| 70 | if (isRunning() && m_queue.isEmpty() && m_doing.isEmpty() && !m_failed.isEmpty() && m_try < 3) { |
| 71 | m_try += 1; |
| 72 | while (!m_failed.isEmpty()) { |
| 73 | auto task = m_failed.take(*m_failed.keyBegin()); |
| 74 | m_done.remove(task.get()); |
| 75 | m_queue.enqueue(task); |
| 76 | } |
| 77 | } |
| 78 | ConcurrentTask::executeNextSubTask(); |
| 79 | } |
| 80 | |
| 81 | auto NetJob::size() const -> int |
| 82 | { |