add crawl time show
This commit is contained in:
@@ -31,6 +31,7 @@ func setupRouter() {
|
||||
"vmess_proxies_count": cache.VmessProxiesCount,
|
||||
"trojan_proxies_count": cache.TrojanProxiesCount,
|
||||
"useful_proxies_count": cache.UsefullProxiesCount,
|
||||
"last_crawl_time": cache.LastCrawlTime,
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -113,6 +113,7 @@
|
||||
<p>vmess节点数量:{{ .vmess_proxies_count }}</p>
|
||||
<p>trojan节点数量:{{ .trojan_proxies_count }}</p>
|
||||
<p>可用节点数量:{{ .useful_proxies_count }}</p>
|
||||
<p>最后更新时间:{{ .last_crawl_time }}</p>
|
||||
<br>
|
||||
<h5><a href="/clash">Clash</a></h5>
|
||||
<p>Clash配置文件:https://{{ .domain }}/clash/config <a
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/zu1k/proxypool/config"
|
||||
"github.com/zu1k/proxypool/internal/cache"
|
||||
@@ -15,6 +16,8 @@ import (
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
var location, _ = time.LoadLocation("PRC")
|
||||
|
||||
func CrawlGo() {
|
||||
if config.NeedFetch {
|
||||
FetchNewConfigFileThenInit()
|
||||
@@ -46,6 +49,7 @@ func CrawlGo() {
|
||||
cache.SSRProxiesCount = proxies.TypeLen("ssr")
|
||||
cache.VmessProxiesCount = proxies.TypeLen("vmess")
|
||||
cache.TrojanProxiesCount = proxies.TypeLen("trojan")
|
||||
cache.LastCrawlTime = time.Now().In(location).Format("2006-01-02 15:04:05")
|
||||
|
||||
// 可用性检测
|
||||
proxies = proxy.CleanBadProxies(proxies)
|
||||
|
||||
2
internal/cache/vars.go
vendored
2
internal/cache/vars.go
vendored
@@ -8,4 +8,6 @@ var (
|
||||
TrojanProxiesCount = 0
|
||||
|
||||
UsefullProxiesCount = 0
|
||||
|
||||
LastCrawlTime = "程序刚升级完成,正在爬取中..."
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user