diff --git a/src/client/WFConsulClient.cc b/src/client/WFConsulClient.cc index b38592bb..ede00c49 100644 --- a/src/client/WFConsulClient.cc +++ b/src/client/WFConsulClient.cc @@ -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; } diff --git a/src/client/WFConsulClient.h b/src/client/WFConsulClient.h index bbb53dbc..96d94a1e 100644 --- a/src/client/WFConsulClient.h +++ b/src/client/WFConsulClient.h @@ -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; }; diff --git a/src/factory/WFTaskError.h b/src/factory/WFTaskError.h index c6143296..6efe8ce2 100644 --- a/src/factory/WFTaskError.h +++ b/src/factory/WFTaskError.h @@ -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 diff --git a/src/manager/WFGlobal.cc b/src/manager/WFGlobal.cc index c1025d8f..bbebdeaf 100644 --- a/src/manager/WFGlobal.cc +++ b/src/manager/WFGlobal.cc @@ -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: