mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 08:02:36 +09:00 
			
		
		
		
	Fix deadlock in webhook PullRequest (#6102)
Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
		@@ -230,12 +230,13 @@ func getDingtalkPullRequestPayload(p *api.PullRequestPayload) (*DingtalkPayload,
 | 
			
		||||
		title = fmt.Sprintf("[%s] Pull request edited: #%d %s", p.Repository.FullName, p.Index, p.PullRequest.Title)
 | 
			
		||||
		text = p.PullRequest.Body
 | 
			
		||||
	case api.HookIssueAssigned:
 | 
			
		||||
		list, err := MakeAssigneeList(&Issue{ID: p.PullRequest.ID})
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return &DingtalkPayload{}, err
 | 
			
		||||
		list := make([]string, len(p.PullRequest.Assignees))
 | 
			
		||||
		for i, user := range p.PullRequest.Assignees {
 | 
			
		||||
			list[i] = user.UserName
 | 
			
		||||
		}
 | 
			
		||||
		title = fmt.Sprintf("[%s] Pull request assigned to %s: #%d %s", p.Repository.FullName,
 | 
			
		||||
			list, p.Index, p.PullRequest.Title)
 | 
			
		||||
			strings.Join(list, ", "),
 | 
			
		||||
			p.Index, p.PullRequest.Title)
 | 
			
		||||
		text = p.PullRequest.Body
 | 
			
		||||
	case api.HookIssueUnassigned:
 | 
			
		||||
		title = fmt.Sprintf("[%s] Pull request unassigned: #%d %s", p.Repository.FullName, p.Index, p.PullRequest.Title)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user