Implement 'inteval' config parameter -> number of seconds between checks
This commit is contained in:
@@ -4,13 +4,14 @@ import (
|
||||
"encoding/json"
|
||||
"flag"
|
||||
"fmt"
|
||||
"github.com/castawaylabs/cachet-monitor/system"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
|
||||
"github.com/castawaylabs/cachet-monitor/system"
|
||||
)
|
||||
|
||||
// Static config
|
||||
@@ -69,6 +70,13 @@ func init() {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
for _, mon := range Config.Monitors {
|
||||
if mon.Interval <= 0 {
|
||||
mon.Interval = 1
|
||||
}
|
||||
mon.stopC = make(chan struct{})
|
||||
}
|
||||
|
||||
if len(systemName) > 0 {
|
||||
Config.SystemName = systemName
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user