feat: curl 没有传回 response 而是传回报错信息的时候也允许重试

This commit is contained in:
zzyyyl
2022-09-03 17:33:04 +08:00
parent 0749e12e55
commit 8cfdfbd4f0

View File

@@ -39,7 +39,9 @@ namespace asst
http::Response report(
const std::string& subtask, const std::string& format,
HttpResponsePred success_cond = [](const http::Response& response) -> bool { return response.success(); },
HttpResponsePred retry_cond = [](const http::Response& response) -> bool { return response.status_5xx(); });
HttpResponsePred retry_cond = [](const http::Response& response) -> bool {
return !response.status_code() || response.status_5xx();
});
ReportType m_report_type = ReportType::Invaild;
std::string m_body;