debug empty audit

This commit is contained in:
Arnas Udovic 2025-07-01 21:47:01 +03:00
parent 3a38cd0f19
commit 9217c047b7
2 changed files with 5 additions and 3 deletions

View file

@ -37,7 +37,7 @@ func doAudit(host string, filter string) bool {
case "empty":
resp, err := http.Get("https://" + host + "/api/v1/server/stats")
if err != nil {
panic(err)
return true
}
defer resp.Body.Close()
@ -49,7 +49,8 @@ func doAudit(host string, filter string) bool {
var generic map[string]any
err = json.NewDecoder(resp.Body).Decode(&generic)
if err != nil {
panic(err)
fmt.Println(err)
return false
}
videos := generic["totalLocalVideos"].(float64)
@ -64,6 +65,7 @@ func doAudit(host string, filter string) bool {
currentTime := time.Now()
last3Month := currentTime.AddDate(0,-3,0)
fmt.Println(instance.CreatedAt, last3Month.Format("2006-01-02T15:04:05Z"), strings.Compare(instance.CreatedAt, last3Month.Format("2006-01-02T15:04:05Z")))
if strings.Compare(instance.CreatedAt, last3Month.Format("2006-01-02T15:04:05Z")) < 1 {
return true
}

View file

@ -166,7 +166,7 @@ func audit(filter string, start int) {
}
for i, url := range hosts {
if i % 100 == 0 {
if i % 20 == 0 {
fmt.Println(i, "(", i+start, ")")
}