diff --git a/global/global.go b/global/global.go index bb7b3c2..8405622 100644 --- a/global/global.go +++ b/global/global.go @@ -32,6 +32,8 @@ var ETLTaskRecord TaskRecord var TaskExtractStatusMap ETLTaskStatus var TaskLoadStatusMap ETLTaskStatus +var ShellPath string + var TransferFuncLi = []string{ "StringToInt", "IntToString", diff --git a/main.go b/main.go index f50c121..fc53889 100644 --- a/main.go +++ b/main.go @@ -96,6 +96,7 @@ func appMain() { if err != nil { log.Fatal("get process dir failed, error:" , err) } + global.ShellPath = path.Join(processDir, "shell") err = InitMustDirectory(processDir) if err != nil { log.Fatal("create need directory failed, error:", err) diff --git a/services/etl/implments/Extract.service.impl.go b/services/etl/implments/Extract.service.impl.go index 302cecd..42995e5 100644 --- a/services/etl/implments/Extract.service.impl.go +++ b/services/etl/implments/Extract.service.impl.go @@ -101,7 +101,7 @@ func (impl *ExtractServiceImplement) StandardExtract(task *model.TaskHead) { ******************************************************************************/ func (impl *ExtractServiceImplement) ExtractByShell(shellLi []model.Shell, task *model.TaskHead, recordDao dal.RecordDao, batchId string, sourceDsn string, targetDsn string) (err error) { for _, shell := range shellLi { - shellPath := path.Join(config.AppConfig.App.ShellPath, shell.ShellName) + shellPath := path.Join(global.ShellPath, shell.ShellName) cmd := exec.Command(shellPath, sourceDsn, targetDsn, global.DatabaseDsn, global.MongoDsn, strconv.Itoa(task.TaskId)) buf, err := cmd.Output()