diff options
author | Matthias Loibl <mail@matthiasloibl.com> | 2017-01-17 06:58:58 +0100 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-01-17 13:58:58 +0800 |
commit | d1006150fb3a82a8dd6e418578dc44474191bfd0 (patch) | |
tree | 99d13e24a1be0d118686106c1f6bbbe4dbaf6793 /models/git_diff.go | |
parent | 6dd096b7f08799ff27d9e34356fb1163ca10f388 (diff) | |
download | gitea-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/git_diff.go')
-rw-r--r-- | models/git_diff.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/models/git_diff.go b/models/git_diff.go index eb88d210d4..d9bb5e9d90 100644 --- a/models/git_diff.go +++ b/models/git_diff.go @@ -483,8 +483,8 @@ func GetDiffRange(repoPath, beforeCommitID, afterCommitID string, maxLines, maxL return nil, fmt.Errorf("Start: %v", err) } - pid := process.Add(fmt.Sprintf("GetDiffRange [repo_path: %s]", repoPath), cmd) - defer process.Remove(pid) + pid := process.GetManager().Add(fmt.Sprintf("GetDiffRange [repo_path: %s]", repoPath), cmd) + defer process.GetManager().Remove(pid) diff, err := ParsePatch(maxLines, maxLineCharacters, maxFiles, stdout) if err != nil { |