Add check to see if instances can fetch videos.

This commit is contained in:
Kavin 2023-07-02 00:41:09 +01:00
parent fab1a5b01c
commit 53e860be10
No known key found for this signature in database
GPG Key ID: 6E4598CA5C92C41F
1 changed files with 10 additions and 0 deletions

10
main.go
View File

@ -183,6 +183,16 @@ func monitorInstances() {
}
}
// check if instance can fetch videos
resp, err = http.Get(ApiUrl + "/streams/jNQXAC9IVRw")
if err != nil {
log.Print(err)
continue
}
if resp.StatusCode != 200 {
continue
}
instances = append(instances, Instance{
Name: strings.TrimSpace(split[0]),
ApiUrl: ApiUrl,