summaryrefslogtreecommitdiffstats
path: root/models/repo_editor.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_editor.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_editor.go')
-rw-r--r--models/repo_editor.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/repo_editor.go b/models/repo_editor.go
index 551200b4e5..53df81bb59 100644
--- a/models/repo_editor.go
+++ b/models/repo_editor.go
@@ -212,8 +212,8 @@ func (repo *Repository) GetDiffPreview(branch, treePath, content string) (diff *
return nil, fmt.Errorf("Start: %v", err)
}
- pid := process.Add(fmt.Sprintf("GetDiffPreview [repo_path: %s]", repo.RepoPath()), cmd)
- defer process.Remove(pid)
+ pid := process.GetManager().Add(fmt.Sprintf("GetDiffPreview [repo_path: %s]", repo.RepoPath()), cmd)
+ defer process.GetManager().Remove(pid)
diff, err = ParsePatch(setting.Git.MaxGitDiffLines, setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles, stdout)
if err != nil {