diff --git a/main.go b/main.go index 0e88a16..4bb0d55 100644 --- a/main.go +++ b/main.go @@ -25,6 +25,7 @@ type Task struct { InStock bool `json:"in_stock"` LastCheck time.Time `json:"last_check"` Status string `json:"status"` + Notified bool `json:"notified"` } type Config struct { @@ -32,11 +33,12 @@ type Config struct { GotifyToken string `json:"gotify_token"` Interval int `json:"interval"` Timeout int `json:"timeout"` + NotifyEnabled bool `json:"notify_enabled"` } var ( tasks = make(map[string]*Task) - config = &Config{Interval: 60, Timeout: 20} + config = &Config{Interval: 60, Timeout: 20, NotifyEnabled: true} mu sync.RWMutex configMu sync.RWMutex authToken = os.Getenv("AUTH_TOKEN") @@ -211,6 +213,9 @@ func handleIndex(w http.ResponseWriter, r *http.Request) {