mirror of
https://github.com/sogou/workflow.git
synced 2026-10-27 10:36:53 +08:00
fix code style
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user