From 6bc11c44504135b232605c932c519901a680d4e1 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 27 Jul 2017 16:53:02 -0400 Subject: hook: fix email not sent after push (#4430) Turns out mail service was not initialized at all, also mail must be sent in sync in hook mode before program exits. --- models/comment.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'models/comment.go') diff --git a/models/comment.go b/models/comment.go index 1be559b0..bcea2268 100644 --- a/models/comment.go +++ b/models/comment.go @@ -188,7 +188,7 @@ func (cmt *Comment) mailParticipants(e Engine, opType ActionType, issue *Issue) issue.Content = fmt.Sprintf("Reopened #%d", issue.Index) } if err = mailIssueCommentToParticipants(issue, cmt.Poster, mentions); err != nil { - log.Error(4, "mailIssueCommentToParticipants: %v", err) + log.Error(2, "mailIssueCommentToParticipants: %v", err) } return nil @@ -290,10 +290,10 @@ func createComment(e *xorm.Session, opts *CreateCommentOptions) (_ *Comment, err // Notify watchers for whatever action comes in, ignore if no action type. if act.OpType > 0 { if err = notifyWatchers(e, act); err != nil { - log.Error(4, "notifyWatchers: %v", err) + log.Error(2, "notifyWatchers: %v", err) } if err = comment.mailParticipants(e, act.OpType, opts.Issue); err != nil { - log.Error(4, "MailParticipants: %v", err) + log.Error(2, "MailParticipants: %v", err) } } -- cgit v1.2.3