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; return true;
} }
Timer wakeTime(global::wallclock()); if (err.getErrorCode() == error_code::HTTP_SERVICE_UNAVAILABLE) {
wakeTime.advance( Timer wakeTime(global::wallclock());
std::chrono::seconds(getOption()->getAsInt(PREF_RETRY_WAIT))); wakeTime.advance(
req_->setWakeTime(wakeTime); std::chrono::seconds(getOption()->getAsInt(PREF_RETRY_WAIT)));
req_->setWakeTime(wakeTime);
}
return prepareForRetry(0); return prepareForRetry(0);
} }
catch (DownloadFailureException& err) { catch (DownloadFailureException& err) {