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
Some checks failed
CI / build (push) Failing after 41s
This commit is contained in:
parent
538aa2e7e8
commit
4018deb0a5
1 changed files with 3 additions and 4 deletions
7
main.go
7
main.go
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue