From 335aff4cd4431a04261a76a97e402653b3dd6078 Mon Sep 17 00:00:00 2001 From: zhangshunping <392956784@qq.com> Date: Tue, 21 Jul 2020 15:44:10 +0800 Subject: [PATCH] add path .git --- .idea/.gitignore | 8 ++++++++ .idea/misc.xml | 6 ++++++ .idea/modules.xml | 8 ++++++++ .idea/p2mocv3pr.iml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ handler/ProducerAndComsumer.go | 26 ++++++++++++-------------- 6 files changed, 48 insertions(+), 14 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/p2mocv3pr.iml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..4aa91ea --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..ef004d1 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..b450f3b --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/p2mocv3pr.iml b/.idea/p2mocv3pr.iml new file mode 100644 index 0000000..bf4c9d3 --- /dev/null +++ b/.idea/p2mocv3pr.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..9661ac7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/handler/ProducerAndComsumer.go b/handler/ProducerAndComsumer.go index 36aeb8c..1c4490e 100755 --- a/handler/ProducerAndComsumer.go +++ b/handler/ProducerAndComsumer.go @@ -4,9 +4,7 @@ import ( "bytes" "fmt" "objectss/database" - "objectss/utils" "os/exec" - "strings" "sync" ) @@ -28,21 +26,21 @@ func Consumer(channel chan string, dbw *database.DbWorker, wg *sync.WaitGroup, o if ok { //取出命令执行 if len(path) != 0 { - pathDir := strings.Replace(path, ".git", "", -1) - utils.Log.Info("path:", pathDir, "ComsumerNume:", ComsuNum) + //pathDir := strings.Replace(path, ".git", "", -1) + //utils.Log.Info("path:", pathDir, "ComsumerNume:", ComsuNum) // 拷贝版本库到oss - ossPath := fmt.Sprintf("%s%s", osslink, pathDir) - copyExec := fmt.Sprintf("obsutil sync %s %s", pathDir, ossPath) + ossPath := fmt.Sprintf("%s%s", osslink, path) + copyExec := fmt.Sprintf("obsutil sync %s %s", path, ossPath) fmt.Println("shell:", copyExec) - s, err := Exec_linux_shell(copyExec) - utils.Log.Info("copy exec_shell: ", s, " err", err) - // 拷贝完成后,更新数据 oss=1 - if err == nil { - dbw.UpdateRepositoryOssbyPath(path) - } else { - utils.Log.Errorf("objectStore upload Failed:commad %s :Git Path %s:shell exec return %", copyExec, pathDir, s, " err", err) - } + //s, err := Exec_linux_shell(copyExec) + //utils.Log.Info("copy exec_shell: ", s, " err", err) + //// 拷贝完成后,更新数据 oss=1 + //if err == nil { + // dbw.UpdateRepositoryOssbyPath(path) + //} else { + // utils.Log.Errorf("objectStore upload Failed:commad %s :Git Path %s:shell exec return %", copyExec, pathDir, s, " err", err) + //} } mu.Lock()