perf: 调整上传线程退出时机

This commit is contained in:
MistEO
2022-09-07 21:26:36 +08:00
parent b44d11089d
commit 92854ebce0

View File

@@ -108,9 +108,6 @@ asst::http::Response asst::ReportDataTask::report(const std::string& subtask, co
http::Response response;
for (int i = 0; i <= m_retry_times; ++i) {
if (need_exit()) {
return {};
}
response = escape_and_request(format);
if (success_cond(response)) {
callback(AsstMsg::SubTaskCompleted, cb_info);
@@ -122,6 +119,9 @@ asst::http::Response asst::ReportDataTask::report(const std::string& subtask, co
else {
Log.trace("retrying... | why:", response.get_last_error(), "status_code:", response.status_code());
}
if (need_exit()) {
break;
}
}
cb_info["why"] = "上报失败";