Commit 91b391b6 authored by Geoff Simmons's avatar Geoff Simmons

configure the idle.pause

parent 70e47621
......@@ -179,6 +179,18 @@ CONF_Add(const char *lval, const char *rval)
return(EINVAL);
}
if (strcmp(lval, "idle.pause") == 0) {
char *p;
errno = 0;
double d = strtod(rval, &p);
if (errno == ERANGE)
return errno;
if (p[0] != '\0' || d < 0 || isnan(d) || !finite(d))
return EINVAL;
config.idle_pause = d;
return 0;
}
return EINVAL;
}
......@@ -198,6 +210,7 @@ CONF_Init(void)
config.maxdata = DEF_MAXDATA;
config.maxkeylen = DEF_MAXKEYLEN;
config.qlen_goal = DEF_QLEN_GOAL;
config.idle_pause = DEF_IDLE_PAUSE;
config.mq_module[0] = '\0';
config.mq_config_file[0] = '\0';
......@@ -253,6 +266,7 @@ CONF_Dump(void)
confdump("nworkers = %u", config.nworkers);
confdump("restarts = %u", config.restarts);
confdump("restart.pause = %u", config.restart_pause);
confdump("idle.pause = %f", config.idle_pause);
confdump("thread.restarts = %u", config.thread_restarts);
confdump("user = %s", config.user_name);
}
......@@ -21,7 +21,7 @@ CMD="../trackrdrd -D -f varnish.binlog -l - -d -c test.conf"
# the user running it
CKSUM=$( $CMD | sed -e 's/\(initializing\) \(.*\)/\1/' | sed -e 's/\(Running as\) \([a-zA-Z0-9]*\)$/\1/' | grep -v 'Not running as root' | cksum)
if [ "$CKSUM" != '3547423616 248886' ]; then
if [ "$CKSUM" != '2726228080 249605' ]; then
echo "ERROR: Regression test incorrect log cksum: $CKSUM"
exit 1
fi
......
......@@ -260,6 +260,8 @@ struct config {
char user_name[BUFSIZ];
uid_t uid;
gid_t gid;
#define DEF_IDLE_PAUSE 0.01
double idle_pause;
} config;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment