mirror of
https://github.com/PrismLauncher/PrismLauncher
synced 2026-04-23 09:05:03 +00:00
NetJob: do not automatically retry on 404 response
Signed-off-by: 0x189D7997 <199489335+0x189D7997@users.noreply.github.com>
This commit is contained in:
parent
f40cbf816e
commit
4a59e6012d
|
|
@ -69,11 +69,15 @@ void NetJob::executeNextSubTask()
|
|||
// 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) {
|
||||
m_try += 1;
|
||||
while (!m_failed.isEmpty()) {
|
||||
auto task = m_failed.take(*m_failed.keyBegin());
|
||||
m_done.remove(task.get());
|
||||
m_queue.enqueue(task);
|
||||
}
|
||||
m_failed.removeIf([this](QHash<Task*, Task::Ptr>::iterator task) {
|
||||
// there is no point in retying on 404 Not Found
|
||||
if (static_cast<Net::NetRequest*>(task->get())->replyStatusCode() == 404) {
|
||||
return false;
|
||||
}
|
||||
m_done.remove(task->get());
|
||||
m_queue.enqueue(*task);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
ConcurrentTask::executeNextSubTask();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue