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:
Lunny Xiao 2019-11-06 21:39:29 +08:00 committed by Lauris BH
parent 72aa5a20ec
commit 12170d26a7
2 changed files with 60 additions and 42 deletions

View file

@ -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)