增强 IP 获取健壮性

This commit is contained in:
naiba 2021-03-22 21:41:31 +08:00
parent 22904e5035
commit 8e95b6565d

View File

@ -4,7 +4,6 @@ import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"time"
)
@ -27,12 +26,6 @@ var ipv6Servers = []string{
var cachedIP, cachedCountry string
func UpdateIP() {
go func() {
for {
log.Println(cachedIP, cachedCountry)
time.Sleep(time.Second)
}
}()
for {
ipv4 := fetchGeoIP(ipv4Servers)
ipv6 := fetchGeoIP(ipv6Servers)