From 53dd0a406340af80c487e4f40533dde25958b0bd Mon Sep 17 00:00:00 2001 From: zhangxin Date: Wed, 11 Aug 2021 17:49:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AEshell=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E4=B8=BA=E5=85=A8=E5=B1=80=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- global/global.go | 2 ++ main.go | 1 + services/etl/implments/Extract.service.impl.go | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) 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() -- 2.30.1.windows.1