ret->retries=std::stoi(boost::get<string>(vars["retries"]));
}
+ if(vars.count("checkInterval")) {
+ ret->checkInterval=static_cast<unsigned int>(std::stoul(boost::get<string>(vars["checkInterval"])));
+ }
+
if(vars.count("tcpConnectTimeout")) {
ret->tcpConnectTimeout=std::stoi(boost::get<string>(vars["tcpConnectTimeout"]));
}
auto states = g_dstates.getLocal(); // this points to the actual shared_ptrs!
for(auto& dss : *states) {
+ if(++dss->lastCheck < dss->checkInterval)
+ continue;
+ dss->lastCheck = 0;
if(dss->availability==DownstreamState::Availability::Auto) {
bool newState=upCheck(*dss);
if (newState) {
int tcpConnectTimeout{5};
int tcpRecvTimeout{30};
int tcpSendTimeout{30};
+ unsigned int checkInterval{1};
+ unsigned int lastCheck{0};
const unsigned int sourceItf{0};
uint16_t retries{5};
uint16_t xpfRRCode{0};
checkFunction=FUNCTION -- Use this function to dynamically set the QNAME, QTYPE and QCLASS to use in the health-check query (see :ref:`Healthcheck`)
setCD=BOOL, -- Set the CD (Checking Disabled) flag in the health-check query, default: false
maxCheckFailures=NUM, -- Allow NUM check failures before declaring the backend down, default: 1
+ checkInterval=NUM -- The time in seconds between health checks
mustResolve=BOOL, -- Set to true when the health check MUST return a NOERROR RCODE and an answer
useClientSubnet=BOOL, -- Add the client's IP address in the EDNS Client Subnet option when forwarding the query to this backend
source=STRING, -- The source address or interface to use for queries to this backend, by default this is left to the kernel's address selection