summaryrefslogtreecommitdiffstats
path: root/models/issue_mail.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2016-12-22 17:00:39 +0800
committerGitHub <noreply@github.com>2016-12-22 17:00:39 +0800
commit0c5c34d7ddaf31a6d8123dac36b221de61f5ff96 (patch)
tree0bfbab9ff4ad4717eab1b8ae60cad4401c421658 /models/issue_mail.go
parent4c89a9c33c4c097836f5bfa79cc7e5adc142a2f0 (diff)
downloadgitea-0c5c34d7ddaf31a6d8123dac36b221de61f5ff96.tar.gz
gitea-0c5c34d7ddaf31a6d8123dac36b221de61f5ff96.zip
UpdateIssueUsersByMentions was calling database write operations while (#443)
a transaction session was in progress. MailParticipants was failing silently because of the SQLITE_LOCKED error. Make sure failures in MailParticipants enter the log, and pass on the transaction context. issue: let caller pass in database context, and use it issue_comment: obtain database context to pass to UpdateIssueMentions issue_comment: log any error from call to MailParticipants issue_mail: pass on database context to UpdateIssueMentions
Diffstat (limited to 'models/issue_mail.go')
-rw-r--r--models/issue_mail.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/issue_mail.go b/models/issue_mail.go
index 56c1e0c278..88adda5619 100644
--- a/models/issue_mail.go
+++ b/models/issue_mail.go
@@ -69,7 +69,7 @@ func mailIssueCommentToParticipants(issue *Issue, doer *User, mentions []string)
// and mentioned people.
func (issue *Issue) MailParticipants() (err error) {
mentions := markdown.FindAllMentions(issue.Content)
- if err = UpdateIssueMentions(issue.ID, mentions); err != nil {
+ if err = UpdateIssueMentions(x, issue.ID, mentions); err != nil {
return fmt.Errorf("UpdateIssueMentions [%d]: %v", issue.ID, err)
}