Commit ed00f14e authored by Rob Riepel's avatar Rob Riepel
Browse files

add poll time variance to ensure prompt reloads

parent 08bb0edd
......@@ -18,6 +18,7 @@ $WEIGHT_PER_LOAD_UNIT = 3; # should be consistent with poller
$poller_sleep = 120;
$poller_results = "/var/lib/poller/lb";
$next_poller_time = 0;
$poller_run_variance = 5; # variance in time to poll all load-balance systems
$default_ttl = 0;
$my_domain = "best.stanford.edu";
$hostmaster = "action.stanford.edu";
......@@ -167,10 +168,10 @@ sub do_reload {
debug("do_reload");
if (time() > $next_poller_time) {
$mtime = (stat($poller_results))[9];
if ($mtime > $next_poller_time) {
if ($mtime >= $next_poller_time) {
debug("reloading config");
load_config($poller_results);
$next_poller_time = $mtime + $poller_sleep;
$next_poller_time = $mtime + $poller_sleep - $poller_run_variance;
$SOA[2] = $mtime; # set SOA serial number
}
}
......
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