]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: checks: create the agent tasks even when no check is configured
authorWilly Tarreau <w@1wt.eu>
Wed, 11 Dec 2013 20:10:14 +0000 (21:10 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 14 Dec 2013 15:02:20 +0000 (16:02 +0100)
Till now, a configuration required at least one health check in the
whole config file to create the agent tasks. Now we start them even
if no health check is enabled.

src/checks.c

index 382bc590706223ac4be41da0a721d1682147cdbc..47dd523a9977e80fb0f9bd25987d6ceb907a5743 100644 (file)
@@ -1765,19 +1765,19 @@ int start_checks() {
                                t->expire = TICK_ETERNITY;
                        }
 
-                       if (!(s->check.state & CHK_ST_CONFIGURED))
-                               continue;
-
-                       if ((srv_getinter(&s->check) >= SRV_CHK_INTER_THRES) &&
-                           (!mininter || mininter > srv_getinter(&s->check)))
-                               mininter = srv_getinter(&s->check);
-
-                       if ((s->agent.state & CHK_ST_CONFIGURED) &&
-                           (srv_getinter(&s->agent) >= SRV_CHK_INTER_THRES) &&
-                           (!mininter || mininter > srv_getinter(&s->agent)))
-                               mininter = srv_getinter(&s->agent);
+                       if (s->check.state & CHK_ST_CONFIGURED) {
+                               nbcheck++;
+                               if ((srv_getinter(&s->check) >= SRV_CHK_INTER_THRES) &&
+                                   (!mininter || mininter > srv_getinter(&s->check)))
+                                       mininter = srv_getinter(&s->check);
+                       }
 
-                       nbcheck++;
+                       if (s->agent.state & CHK_ST_CONFIGURED) {
+                               nbcheck++;
+                               if ((srv_getinter(&s->agent) >= SRV_CHK_INTER_THRES) &&
+                                   (!mininter || mininter > srv_getinter(&s->agent)))
+                                       mininter = srv_getinter(&s->agent);
+                       }
                }
        }