mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-08-06 01:37:25 +08:00
Fix deadlock in webhook PullRequest (#6102)
Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
@ -347,12 +347,13 @@ func getDiscordPullRequestPayload(p *api.PullRequestPayload, meta *DiscordMeta)
|
||||
text = p.PullRequest.Body
|
||||
color = warnColor
|
||||
case api.HookIssueAssigned:
|
||||
list, err := MakeAssigneeList(&Issue{ID: p.PullRequest.ID})
|
||||
if err != nil {
|
||||
return &DiscordPayload{}, 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)
|
||||
title = fmt.Sprintf("[%s] Pull request assigned to %s: #%d by %s", p.Repository.FullName,
|
||||
strings.Join(list, ", "),
|
||||
p.Index, p.PullRequest.Title)
|
||||
text = p.PullRequest.Body
|
||||
color = successColor
|
||||
case api.HookIssueUnassigned:
|
||||
|
Reference in New Issue
Block a user