frigate/uptime-go/uptime/main.go

18 lines
529 B
Go

package main
import "time"
import (
"frigate/uptime/config"
"frigate/uptime/notify"
)
func main() {
var uptimeConfig = config.ReadConfig("config/config.yaml")
var pingInterval = time.Duration(uptimeConfig.PingIntervalSeconds * int64(time.Second))
var pingTimeout = time.Duration(uptimeConfig.PingTimeoutSeconds * int64(time.Second))
var cameraMonitor CameraMonitor = NewCameraMonitor(pingInterval, pingTimeout, uptimeConfig.ConsecutiveDownThreshold, notify.NewNtfyNotifier())
cameraMonitor.Run(uptimeConfig.Cameras)
}