still fixing patch on server side IP address

This commit is contained in:
2021-04-16 17:02:08 +04:00
parent 1504496eb1
commit 4e22572c7b
2 changed files with 19 additions and 6 deletions

View File

@@ -2,9 +2,21 @@
"ip_address": [
{
"ipv4": "145.40.90.151",
"latency": 139109233,
"download": 6.383175565123993,
"upload": 896786.5894533413
"latency": 136977360,
"download": 6.439557936207414,
"upload": 1247166.5933956294
},
{
"ipv4": "86.99.70.106",
"latency": 8933343,
"download": 201730.13853312942,
"upload": 2203225.5221644486
},
{
"ipv4": "86.99.70.106",
"latency": 0,
"download": 0,
"upload": 0
}
]
}

View File

@@ -64,14 +64,15 @@ func (ip *IpAddresses)SpeedTestUpdatedIPTable() error{
}
// To ensure struct has no duplicates IP addresses
DoNotRead := targets
//DoNotRead := targets
// Appends all IP addresses
for i, _ := range targets.IpAddress {
// To ensure that there are no duplicate IP addresses
Exists := false
for k := range DoNotRead.IpAddress {
if DoNotRead.IpAddress[k].Ipv4 == targets.IpAddress[i].Ipv4 {
for k := range ip.IpAddress {
if ip.IpAddress[k].Ipv4 == targets.IpAddress[i].Ipv4 {
Exists = true
break
}