From f3d1415f01b6db394cb31d232662cd6db204fd5f Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期一, 23 十二月 2019 09:31:50 +0800 Subject: [PATCH] update; --- app/master/master.go | 31 +++---------------------------- 1 files changed, 3 insertions(+), 28 deletions(-) diff --git a/app/master/master.go b/app/master/master.go index 1180edc..fa83f15 100644 --- a/app/master/master.go +++ b/app/master/master.go @@ -5,7 +5,6 @@ "analysis/logo" "analysis/util" "context" - "io/ioutil" "basic.com/libgowrapper/sdkstruct.git" ) @@ -17,36 +16,12 @@ } // Run run -func Run(ctx context.Context, configPath string) bool { +func Run(ctx context.Context, configPath, soFile string) bool { reaper(ctx) - rPath := configPath - configFile := configPath - var fetcher *Fetcher - - fs, _ := ioutil.ReadDir(rPath) - for _, file := range fs { - if !file.IsDir() { - if rPath[len(rPath)-1] != '/' { - configFile = rPath + "/" + file.Name() - } else { - configFile = rPath + file.Name() - } - - cfg, err := app.ReadConfig(configFile) - if err != nil { - logo.Errorln("Run Fetcher Master Read From File: ", configFile, " Config Error: ", err) - continue - } - fetcher = NewFetcher(cfg.SoFile) - if fetcher == nil { - logo.Errorln("New Fetcher Load so File Funcs Error From File: ", cfg.SoFile) - continue - } - } - } + fetcher := NewFetcher(soFile) if fetcher == nil { - logo.Errorln("!!!!!!Read All So File, But Can't Init DB Fetcher") + logo.Errorln("New Fetcher Load so File Funcs Error From File: ", soFile) return false } -- Gitblit v1.8.0