| | |
| | | "analysis/logo" |
| | | "analysis/util" |
| | | "context" |
| | | "io/ioutil" |
| | | |
| | | "basic.com/libgowrapper/sdkstruct.git" |
| | | ) |
| | |
| | | } |
| | | |
| | | // 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 |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | args = append(args, app.GetParams(util.ConfigPath, file)...) |
| | | pid, err := runProc(ctx, "./analysis", args, &cfg.Env) |
| | | pid, err := runProc(ctx, "./analysis", args, cfg.Env) |
| | | |
| | | if err != nil { |
| | | logo.Errorf("ANALYSIS START SLAVE PROC %s IPC: %s error %+v\n", v.SdkType, v.IpcID, err) |