Apply --retry-wait on 503 only

pull/693/head
Tatsuhiro Tsujikawa 2016-06-21 23:46:54 +09:00
parent e8fcedf092
commit d38da969a5
1 changed files with 7 additions and 4 deletions

View File

@ -380,10 +380,13 @@ bool AbstractCommand::execute()
return true;
}
Timer wakeTime(global::wallclock());
wakeTime.advance(
std::chrono::seconds(getOption()->getAsInt(PREF_RETRY_WAIT)));
req_->setWakeTime(wakeTime);
if (err.getErrorCode() == error_code::HTTP_SERVICE_UNAVAILABLE) {
Timer wakeTime(global::wallclock());
wakeTime.advance(
std::chrono::seconds(getOption()->getAsInt(PREF_RETRY_WAIT)));
req_->setWakeTime(wakeTime);
}
return prepareForRetry(0);
}
catch (DownloadFailureException& err) {