summaryrefslogtreecommitdiffstats
path: root/models/repo_mirror.go
diff options
context:
space:
mode:
authorMatthias Loibl <mail@matthiasloibl.com>2017-01-17 06:58:58 +0100
committerLunny Xiao <xiaolunwen@gmail.com>2017-01-17 13:58:58 +0800
commitd1006150fb3a82a8dd6e418578dc44474191bfd0 (patch)
tree99d13e24a1be0d118686106c1f6bbbe4dbaf6793 /models/repo_mirror.go
parent6dd096b7f08799ff27d9e34356fb1163ca10f388 (diff)
downloadgitea-d1006150fb3a82a8dd6e418578dc44474191bfd0.tar.gz
gitea-d1006150fb3a82a8dd6e418578dc44474191bfd0.zip
Refactor process package and introduce ProcessManager{} with tests (#75)
* Add a process.Manager singleton with process.GetManager() * Use process.GetManager everywhere * Fix godoc comments for process module * Increment process counter id after locking the mutex
Diffstat (limited to 'models/repo_mirror.go')
-rw-r--r--models/repo_mirror.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/repo_mirror.go b/models/repo_mirror.go
index abe70de1ab..99760c1496 100644
--- a/models/repo_mirror.go
+++ b/models/repo_mirror.go
@@ -137,7 +137,7 @@ func (m *Mirror) runSync() bool {
gitArgs = append(gitArgs, "--prune")
}
- if _, stderr, err := process.ExecDir(
+ if _, stderr, err := process.GetManager().ExecDir(
timeout, repoPath, fmt.Sprintf("Mirror.runSync: %s", repoPath),
"git", gitArgs...); err != nil {
desc := fmt.Sprintf("Fail to update mirror repository '%s': %s", repoPath, stderr)
@@ -148,7 +148,7 @@ func (m *Mirror) runSync() bool {
return false
}
if m.Repo.HasWiki() {
- if _, stderr, err := process.ExecDir(
+ if _, stderr, err := process.GetManager().ExecDir(
timeout, wikiPath, fmt.Sprintf("Mirror.runSync: %s", wikiPath),
"git", "remote", "update", "--prune"); err != nil {
desc := fmt.Sprintf("Fail to update mirror wiki repository '%s': %s", wikiPath, stderr)