update
This commit is contained in:
@ -6,7 +6,10 @@ import (
|
||||
"my-spiders/internal/spider"
|
||||
)
|
||||
|
||||
var theImpressionMaxCo int
|
||||
var (
|
||||
theImpressionMaxCo int
|
||||
theImpressionMaxArticles int
|
||||
)
|
||||
|
||||
var theImpressionCmd = &cobra.Command{
|
||||
Use: "theimpression",
|
||||
@ -18,6 +21,7 @@ var theImpressionCmd = &cobra.Command{
|
||||
// 复用全局 -d/--debug 标志
|
||||
isDebug := debug
|
||||
s := spider.NewTheImpressionSpider(theImpressionMaxCo, IngestClient)
|
||||
s.MaxArticles = theImpressionMaxArticles
|
||||
s.Debug = isDebug
|
||||
s.Run()
|
||||
},
|
||||
@ -26,4 +30,5 @@ var theImpressionCmd = &cobra.Command{
|
||||
func init() {
|
||||
rootCmd.AddCommand(theImpressionCmd)
|
||||
theImpressionCmd.Flags().IntVarP(&theImpressionMaxCo, "max-co", "m", 5, "最大并发数限制")
|
||||
theImpressionCmd.Flags().IntVarP(&theImpressionMaxArticles, "max-articles", "n", 0, "最多抓取的街拍任务数(0=不限制,小批量试抓用)")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user