This commit is contained in:
2024-01-14 18:40:47 -06:00
parent 12167e8d5a
commit a4430227e3
17 changed files with 13370 additions and 48 deletions

View File

@@ -2,12 +2,10 @@ package cisa
import (
"encoding/json"
"net/http"
"sync"
"time"
"istheinternetonfire.app/internal/config"
"istheinternetonfire.app/internal/httpclient"
)
var (
@@ -24,12 +22,16 @@ func Read() CisaJSON {
func Start() {
for {
c := httpclient.NewClient(http.DefaultClient)
d, err := c.Get(config.Cfg.RemoteURL)
if err != nil {
time.Sleep(time.Second * 120)
continue
}
/*
c := httpclient.NewClient(http.DefaultClient)
d, err := c.Get(config.Cfg.RemoteURL)
if err != nil {
time.Sleep(time.Second * 120)
continue
}
*/
d := GetExampleData()
mu.Lock()
if err := json.Unmarshal(d, &Cisa); err != nil {