File tree 2 files changed +26
-0
lines changed
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package main
2
2
3
3
import (
4
4
"flag"
5
+ "log"
5
6
"polaris/crawler-distributed/config"
6
7
itemsaver "polaris/crawler-distributed/persist/client"
7
8
"polaris/crawler-distributed/pool"
@@ -24,6 +25,27 @@ func main() {
24
25
// run itemsaver.go first
25
26
// then to run worker.go
26
27
flag .Parse ()
28
+
29
+ if * itemSaverHost == "" && * workerHosts == "" {
30
+ log .Println ("Must specify one or more itemsaver host, like this:\n " +
31
+ "go run main.go --itemsaver_host=\" :9200\" " )
32
+ log .Println ("Must specify one or more worker host, like this:\n " +
33
+ "go run main.go --worker_host=\" 9300\" " )
34
+ log .Print ("You can typing the go run main.go --help for get help" )
35
+ return
36
+ }
37
+ if * itemSaverHost == "" {
38
+ log .Print ("Must specify one or more itemsaver host, like this:\n " +
39
+ "go run main.go --itemsaver_host=\" :9200\" " )
40
+ return
41
+ }
42
+
43
+ if * workerHosts == "" {
44
+ log .Print ("Must specify one or more worker host, like this:\n " +
45
+ "go run main.go --worker_host=\" 9300\" " )
46
+ return
47
+ }
48
+
27
49
itemChan , err := itemsaver .ItemSaver (* itemSaverHost )
28
50
if err != nil {
29
51
panic (err )
Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ func main() {
26
26
parser .ParseCityList ,
27
27
config .ParseCityList ),
28
28
})
29
+
30
+
31
+ // unblock the following code, we can got zhenai.com user details.
32
+
29
33
/*e.Run(engine.Request{
30
34
Url: shanghai,
31
35
Parser: engine.NewFuncParser(
You can’t perform that action at this time.
0 commit comments