show count

This commit is contained in:
zu1k
2020-08-12 17:58:51 +08:00
parent 304de88e96
commit c87b5872e2
2 changed files with 6 additions and 3 deletions

View File

@@ -54,6 +54,7 @@ func Crawl() {
for i := 0; i < num; i++ {
proxies[i].SetName(strconv.Itoa(rand.Int()))
}
log.Println("Crawl node count:", num)
cache.SetProxies(proxies)
cache.SetString("clashproxies", provider.Clash{Proxies: proxies}.Provide())
}

View File

@@ -19,9 +19,11 @@ func Deduplication(src []Proxy) []Proxy {
result := make([]Proxy, 0, len(src))
temp := map[string]struct{}{}
for _, item := range src {
if _, ok := temp[item.Identifier()]; !ok {
temp[item.Identifier()] = struct{}{}
result = append(result, item)
if item != nil {
if _, ok := temp[item.Identifier()]; !ok {
temp[item.Identifier()] = struct{}{}
result = append(result, item)
}
}
}
return result