fix code style

This commit is contained in:
dapengwang
2022-03-16 19:13:35 +08:00
parent a3a9101d7e
commit dec10e9100
4 changed files with 11 additions and 13 deletions
+2 -2
View File
@@ -330,7 +330,7 @@ bool WFConsulTask::check_task_result(WFHttpTask *task, WFConsulTask *consul_task
if (http_code < 200 || http_code >= 400)
{
consul_task->state = WFT_STATE_TASK_ERROR;
consul_task->error = WFT_ERR_CONSUL_CHECK_RESPONSE_ERROR;
consul_task->error = WFT_ERR_CONSUL_CHECK_RESPONSE_FAILED;
consul_task->error_reason = resp->get_reason_phrase();
return false;
}
@@ -409,7 +409,7 @@ int WFConsulClient::init(const std::string& proxy_url)
int WFConsulClient::init(const std::string& proxy_url, ConsulConfig config)
{
this->proxy_url = proxy_url;
this->config = config;
this->config = std::move(config);
return 0;
}
+7 -9
View File
@@ -80,14 +80,6 @@ protected:
}
protected:
WFConsulTask(const std::string& proxy_url,
const std::string& service_namespace,
const std::string& service_name,
const std::string& service_id,
int retry_max, consul_callback_t&& cb);
virtual ~WFConsulTask() {}
virtual void dispatch();
virtual SubTask *done();
@@ -117,7 +109,13 @@ protected:
long long consul_index;
consul_callback_t callback;
private:
protected:
WFConsulTask(const std::string& proxy_url,
const std::string& service_namespace,
const std::string& service_name,
const std::string& service_id,
int retry_max, consul_callback_t&& cb);
virtual ~WFConsulTask() {}
friend class WFConsulClient;
};
+1 -1
View File
@@ -66,7 +66,7 @@ enum
//CONSUL
WFT_ERR_CONSUL_API_UNKNOWN = 6001, ///< api type not supported
WFT_ERR_CONSUL_CHECK_RESPONSE_ERROR = 6002, ///< Consul http code failed
WFT_ERR_CONSUL_CHECK_RESPONSE_FAILED = 6002, ///< Consul http code failed
};
#endif
+1 -1
View File
@@ -828,7 +828,7 @@ static inline const char *__get_task_error_string(int error)
case WFT_ERR_CONSUL_API_UNKNOWN:
return "Consul api type unknown";
case WFT_ERR_CONSUL_CHECK_RESPONSE_ERROR:
case WFT_ERR_CONSUL_CHECK_RESPONSE_FAILED:
return "Consul check response failed";
default: