mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-03 21:08:25 +00:00 
			
		
		
		
	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
This commit is contained in:
		
				
					committed by
					
						
						Lunny Xiao
					
				
			
			
				
	
			
			
			
						parent
						
							6dd096b7f0
						
					
				
				
					commit
					d1006150fb
				
			@@ -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 {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user