this is supposed to execute every second to be able to calulate the difference of the transmitted bytes
Some checks failed
CI / build (push) Failing after 41s

This commit is contained in:
Fijxu 2025-02-13 02:21:18 -03:00
parent 538aa2e7e8
commit 4018deb0a5
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4

View file

@ -334,10 +334,10 @@ func requestPerMinute() {
// returns, which most of the time is 403 (Forbidden). But this error code is not
// exclusive to IP blocks, it's also returned for other reasons like a wrong
// query parameter like `pot` (po_token) or anything like that.
func blockChecker(gh string, cooldown int) {
func blockChecker(gh string) {
log.Println("[INFO] Starting blockchecker")
// Sleep for 30 seconds before commencing the loop
time.Sleep(30 * time.Second)
// Sleep for 60 seconds before commencing the loop
time.Sleep(60 * time.Second)
url := "http://" + gh + "/v1/openvpn/status"
p, err := procfs.Self()
@ -364,7 +364,6 @@ func blockChecker(gh string, cooldown int) {
} else {
log.Printf("[INFO] Request to change IP sent to gluetun successfully")
}
time.Sleep(time.Duration(cooldown) * time.Second)
}
last = current
}