Commit 69017a2beac1630119ed101a6687d271df73520c

Authored by Adhidarma Hadiwinoto
1 parent 436f569a0e
Exists in master

Konfigurasi probe interval dan max random delay dalam detik

Showing 1 changed file with 6 additions and 6 deletions Side-by-side Diff

... ... @@ -4,8 +4,8 @@ var config;
4 4 var matrix;
5 5 var sendMessage;
6 6  
7   -var defaultProbeInterval = 60 * 1000;
8   -var defaultProbeMaxRandomDelay = 10 * 1000;
  7 +var defaultProbeIntervalSecs = 60;
  8 +var defaultProbeMaxRandomDelaySecs = 10;
9 9  
10 10 function init(options) {
11 11 config = options.config;
... ... @@ -80,13 +80,13 @@ function pingAll() {
80 80 }
81 81  
82 82 function getProbeInterval() {
83   - if (!config || !config.globals || !config.globals.probe_interval) { return defaultProbeInterval; }
84   - return config.globals.probe_interval;
  83 + if (!config || !config.globals || !config.globals.probe_interval_secs) { return defaultProbeIntervalSecs * 1000; }
  84 + return config.globals.probe_interval_secs * 1000;
85 85 }
86 86  
87 87 function getProbeMaxRandomDelay() {
88   - if (!config || !config.globals || !config.globals.probe_max_random_delay) { return defaultProbeInterval; }
89   - return config.globals.probe_max_random_delay;
  88 + if (!config || !config.globals || !config.globals.probe_max_random_delay_secs) { return defaultProbeIntervalSecs * 1000; }
  89 + return config.globals.probe_max_random_delay_secs * 1000;
90 90 }
91 91  
92 92 exports.init = init;