Split sendCreateCommentAction as two parts, one for update comment related informations, another for actions (#8784)
* Split sendCreateCommentAction as two parts, one for update comment related informations, another for actions * fix lint
This commit is contained in:
parent
72aa5a20ec
commit
12170d26a7
2 changed files with 60 additions and 42 deletions
|
@ -129,13 +129,17 @@ func (r *Review) publish(e *xorm.Engine) error {
|
|||
go func(en *xorm.Engine, review *Review, comm *Comment) {
|
||||
sess := en.NewSession()
|
||||
defer sess.Close()
|
||||
if err := sendCreateCommentAction(sess, &CreateCommentOptions{
|
||||
opts := &CreateCommentOptions{
|
||||
Doer: comm.Poster,
|
||||
Issue: review.Issue,
|
||||
Repo: review.Issue.Repo,
|
||||
Type: comm.Type,
|
||||
Content: comm.Content,
|
||||
}, comm); err != nil {
|
||||
}
|
||||
if err := updateCommentInfos(sess, opts, comm); err != nil {
|
||||
log.Warn("updateCommentInfos: %v", err)
|
||||
}
|
||||
if err := sendCreateCommentAction(sess, opts, comm); err != nil {
|
||||
log.Warn("sendCreateCommentAction: %v", err)
|
||||
}
|
||||
}(e, r, comment)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue