small tweaks
This commit is contained in:
@@ -2,10 +2,12 @@ package cisa
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"istheinternetonfire.app/internal/config"
|
||||
"istheinternetonfire.app/internal/httpclient"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -22,16 +24,12 @@ 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
|
||||
}
|
||||
*/
|
||||
|
||||
d := GetExampleData()
|
||||
c := httpclient.NewClient(http.DefaultClient)
|
||||
d, err := c.Get(config.Cfg.RemoteURL)
|
||||
if err != nil {
|
||||
time.Sleep(time.Second * 120)
|
||||
continue
|
||||
}
|
||||
|
||||
mu.Lock()
|
||||
if err := json.Unmarshal(d, &Cisa); err != nil {
|
||||
|
Reference in New Issue
Block a user