Merge branch 'master' into master

This commit is contained in:
liyingxin
2021-02-18 22:10:20 +08:00
committed by GitHub
3 changed files with 12 additions and 6 deletions
+1
View File
@@ -18,3 +18,4 @@ if (KAFKA STREQUAL "y")
)
add_library("factory_kafka" OBJECT ${SRC})
endif ()
+8 -3
View File
@@ -22,16 +22,21 @@
#include "WFNameService.h"
#include "WFDNSResolver.h"
#include "ServiceGovernance.h"
#include "UpstreamManager.h"
#define DNS_CACHE_LEVEL_1 1
#define DNS_CACHE_LEVEL_2 2
PolicyAddrParams::PolicyAddrParams()
{
PolicyAddrParams(ADDRESS_PARAMS_DEFAULT);
const AddressParams *params = &ADDRESS_PARAMS_DEFAULT;
this->endpoint_params = params->endpoint_params;
this->dns_ttl_default = params->dns_ttl_default;
this->dns_ttl_min = params->dns_ttl_min;
this->max_fails = params->max_fails;
}
PolicyAddrParams::PolicyAddrParams(const struct AddressParams *params) :
PolicyAddrParams::PolicyAddrParams(const AddressParams *params) :
endpoint_params(params->endpoint_params)
{
this->dns_ttl_default = params->dns_ttl_default;
@@ -214,7 +219,7 @@ void ServiceGovernance::check_breaker()
}
}
}
pthread_mutex_unlock(&this->breaker_lock);
pthread_mutex_unlock(&this->breaker_lock);
}
const EndpointAddress *ServiceGovernance::first_stradegy(const ParsedURI& uri)
+3 -3
View File
@@ -17,7 +17,7 @@
*/
#ifndef _SERVICE_GOVERNANCE_H_
#define _SERVICE_GOVERNANCE_H_
#define _SERVICE_GOVERNANCE_H_
#include <pthread.h>
#include <unordered_map>
@@ -31,7 +31,7 @@
#include "WFTaskError.h"
#include "UpstreamManager.h"
#define MTTR_SECOND_DEFAULT 30
#define MTTR_SECOND_DEFAULT 30
#define VIRTUAL_GROUP_SIZE 16
#define GET_CURRENT_SECOND std::chrono::duration_cast<std::chrono::seconds>(std::chrono::steady_clock::now().time_since_epoch()).count()
@@ -53,7 +53,7 @@ public:
unsigned int max_fails;
PolicyAddrParams();
PolicyAddrParams(const struct AddressParams *params);
PolicyAddrParams(const AddressParams *params);
};
class EndpointAddress