mirror of
https://github.com/sogou/workflow.git
synced 2026-02-08 01:33:17 +08:00
update upstream_delete() ret, 0:success, -1:not existed.
This commit is contained in:
@@ -138,10 +138,7 @@ int UpstreamManager::upstream_remove_server(const std::string& name,
|
||||
UPSGroupPolicy *policy = dynamic_cast<UPSGroupPolicy *>(ns->get_policy(name.c_str()));
|
||||
|
||||
if (policy)
|
||||
{
|
||||
policy->remove_server(address);
|
||||
return 0;
|
||||
}
|
||||
return policy->remove_server(address);
|
||||
|
||||
errno = ENOENT;
|
||||
return -1;
|
||||
@@ -150,15 +147,16 @@ int UpstreamManager::upstream_remove_server(const std::string& name,
|
||||
int UpstreamManager::upstream_delete(const std::string& name)
|
||||
{
|
||||
WFNameService *ns = WFGlobal::get_name_service();
|
||||
auto *policy = ns->del_policy(name.c_str());
|
||||
WFNSPolicy *policy = ns->del_policy(name.c_str());
|
||||
|
||||
if (policy)
|
||||
{
|
||||
delete policy;
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
errno = ENOENT;
|
||||
return -1;
|
||||
}
|
||||
|
||||
std::vector<std::string>
|
||||
|
||||
@@ -131,8 +131,8 @@ public:
|
||||
* @brief Delete one upstream
|
||||
* @param[in] name upstream name
|
||||
* @return success/fail
|
||||
* @retval 0 fail, not found
|
||||
* @retval 1 success
|
||||
* @retval 0 success
|
||||
* @retval -1 fail, not found
|
||||
*/
|
||||
static int upstream_delete(const std::string& name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user