1
0
Fork 0

fix duplicated webhook when creating issue with assignees (#7681)

This commit is contained in:
Lunny Xiao 2019-07-31 17:24:38 +08:00 committed by GitHub
parent ce27e48fe3
commit 0742f717ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -142,11 +142,15 @@ func (issue *Issue) ChangeAssignee(doer *User, assigneeID int64) (err error) {
return err
}
return sess.Commit()
if err := sess.Commit(); err != nil {
return err
}
go HookQueue.Add(issue.RepoID)
return nil
}
func (issue *Issue) changeAssignee(sess *xorm.Session, doer *User, assigneeID int64, isCreate bool) (err error) {
// Update the assignee
removed, err := updateIssueAssignee(sess, issue, assigneeID)
if err != nil {
@ -209,7 +213,6 @@ func (issue *Issue) changeAssignee(sess *xorm.Session, doer *User, assigneeID in
return nil
}
}
go HookQueue.Add(issue.RepoID)
return nil
}