| | |
| | | "analysis/logo" |
| | | "analysis/util" |
| | | "context" |
| | | |
| | | "github.com/spf13/viper" |
| | | ) |
| | | |
| | | func reaper(ctxt context.Context) { |
| | |
| | | |
| | | util.InitDBAPI() |
| | | |
| | | const ( |
| | | configFilePath = "/opt/vasystem/config/" |
| | | configFileName = "sdkconfig" |
| | | configFileType = "yaml" |
| | | ) |
| | | viper.SetConfigType(configFileType) |
| | | viper.SetConfigName(configFileName) |
| | | viper.AddConfigPath(configFilePath) |
| | | viper.AddConfigPath("./") |
| | | |
| | | envString := "" |
| | | |
| | | sdks := util.SDKInfo() |
| | | for k, v := range sdks { |
| | | |
| | | if err := viper.ReadInConfig(); err == nil { |
| | | |
| | | envString = viper.GetString(v.SdkType) |
| | | |
| | | } |
| | | logo.Errorln("MASTER ANALYSIS START SLAVE TYPE: ", v.SdkType, " SDK CONFIG: ", envString) |
| | | |
| | | args := []string{ |
| | | `-role=slave`, |
| | | "-sdk=" + v.SdkType, |
| | | "-id=" + v.IpcId, |
| | | } |
| | | |
| | | args = append(args, (*util.GetParams())...) |
| | | |
| | | pid, err := runProc(ctx, "./analysis", args) |
| | | pid, err := runProc(ctx, "./analysis", args, &envString) |
| | | |
| | | if err != nil { |
| | | logo.Errorf("ANALYSIS START SLAVE PROC %s IPC: %s error %+v\n", v.SdkType, v.IpcId, err) |