Commit b515d23b authored by 王明明's avatar 王明明

更换goquery

parent 782d5483
...@@ -9,7 +9,6 @@ import ( ...@@ -9,7 +9,6 @@ import (
"gopkg.in/natefinch/lumberjack.v2" "gopkg.in/natefinch/lumberjack.v2"
"log" "log"
"net/http" "net/http"
_ "net/http/pprof"
"path" "path"
"test/model" "test/model"
"test/util" "test/util"
...@@ -20,9 +19,6 @@ func WelcomeHandler(w http.ResponseWriter, r *http.Request) { ...@@ -20,9 +19,6 @@ func WelcomeHandler(w http.ResponseWriter, r *http.Request) {
} }
func main() { func main() {
go func() {
log.Println(http.ListenAndServe("0.0.0.0:6060", nil))
}()
logname := flag.String("logname", "akm.log", "日志文件名") logname := flag.String("logname", "akm.log", "日志文件名")
flag.Parse() flag.Parse()
......
...@@ -70,21 +70,20 @@ func (akm *AkmClient) Init() error { ...@@ -70,21 +70,20 @@ func (akm *AkmClient) Init() error {
for _, attr := range attrs { for _, attr := range attrs {
if attr.Key == "src" && !strings.Contains(attr.Val, ".") { if attr.Key == "src" && !strings.Contains(attr.Val, ".") {
akm.SensorUrl = fmt.Sprintf("%s://%s%s", uri.Scheme, uri.Host, attr.Val) akm.SensorUrl = fmt.Sprintf("%s://%s%s", uri.Scheme, uri.Host, attr.Val)
break goto continute
} }
} }
startIdx-- startIdx--
lastScript = scripts[startIdx] lastScript = scripts[startIdx]
} }
continute:
// akm.SensorUrl = fmt.Sprintf("%s://%s%s", uri.Scheme, uri.Host, matchs[1]) // akm.SensorUrl = fmt.Sprintf("%s://%s%s", uri.Scheme, uri.Host, matchs[1])
if akm.SensorUrl == "" { if akm.SensorUrl == "" {
akm.logger.Errorln("提取不到sensorUrl失败") akm.logger.Errorln("提取不到sensorUrl失败")
return errors.New("提取不到sensorUrl 失败") return errors.New("提取不到sensorUrl 失败")
} }
akm.logger.Info("请求sensor url:", akm.SensorUrl) akm.logger.Info("初始化abck 耗时", time.Since(startTime).String(), " 请求sensor url:", akm.SensorUrl)
akm.logger.Info("初始化abck 耗时", time.Since(startTime).String())
return nil return nil
} }
func NewAkmClient(initUrl, postUrl, proxyUrl string, logger *logrus.Entry) *AkmClient { func NewAkmClient(initUrl, postUrl, proxyUrl string, logger *logrus.Entry) *AkmClient {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment