mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
NetJob: do not automatically retry on 404 Not Found response (#5416)
This commit is contained in:
commit
b595488487
1 changed files with 9 additions and 5 deletions
|
|
@ -69,11 +69,15 @@ void NetJob::executeNextSubTask()
|
||||||
// We're finished, check for failures and retry if we can (up to 3 times)
|
// We're finished, check for failures and retry if we can (up to 3 times)
|
||||||
if (isRunning() && m_queue.isEmpty() && m_doing.isEmpty() && !m_failed.isEmpty() && m_try < 3) {
|
if (isRunning() && m_queue.isEmpty() && m_doing.isEmpty() && !m_failed.isEmpty() && m_try < 3) {
|
||||||
m_try += 1;
|
m_try += 1;
|
||||||
while (!m_failed.isEmpty()) {
|
m_failed.removeIf([this](QHash<Task*, Task::Ptr>::iterator task) {
|
||||||
auto task = m_failed.take(*m_failed.keyBegin());
|
// there is no point in retying on 404 Not Found
|
||||||
m_done.remove(task.get());
|
if (static_cast<Net::NetRequest*>(task->get())->replyStatusCode() == 404) {
|
||||||
m_queue.enqueue(task);
|
return false;
|
||||||
}
|
}
|
||||||
|
m_done.remove(task->get());
|
||||||
|
m_queue.enqueue(*task);
|
||||||
|
return true;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
ConcurrentTask::executeNextSubTask();
|
ConcurrentTask::executeNextSubTask();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue