zu1k 5 years ago
parent
commit
3127fe6e2c
3 changed files with 3 additions and 3 deletions
  1. 1 2
      app/cron.go
  2. 1 1
      app/task.go
  3. 1 0
      main.go

+ 1 - 2
app/cron.go

@@ -5,7 +5,6 @@ import (
 )
 
 func Cron() {
-	gocron.Every(10).Minutes().Do(CrawlTGChannel)
-
+	_ = gocron.Every(10).Minutes().Do(CrawlTGChannel)
 	<-gocron.Start()
 }

+ 1 - 1
app/task.go

@@ -41,7 +41,7 @@ func CrawlTGChannel() {
 
 	num := len(proxies)
 	for i := 0; i < num; i++ {
-		proxies[i].SetName("@tgbotlist_" + strconv.Itoa(rand.Int()))
+		proxies[i].SetName(strconv.Itoa(rand.Int()))
 	}
 	cache.SetProxies(proxies)
 	cache.SetString("clashproxies", provider.Clash{Proxies: proxies}.Provide())

+ 1 - 0
main.go

@@ -8,6 +8,7 @@ import (
 )
 
 func main() {
+	go app.Cron()
 	fmt.Println("Do the first crawl...")
 	app.CrawlTGChannel()
 	api.Run()