Skip to content

Commit 385fda5

Browse files
committed
improvements
1 parent f5be627 commit 385fda5

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

services/issue/comments.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
user_model "code.gitea.io/gitea/models/user"
1616
"code.gitea.io/gitea/modules/gitrepo"
1717
"code.gitea.io/gitea/modules/json"
18+
"code.gitea.io/gitea/modules/log"
1819
"code.gitea.io/gitea/modules/timeutil"
1920
git_service "code.gitea.io/gitea/services/git"
2021
notify_service "code.gitea.io/gitea/services/notify"
@@ -91,14 +92,9 @@ func CreateIssueComment(ctx context.Context, doer *user_model.User, repo *repo_m
9192
return nil, err
9293
}
9394

94-
return comment, notifyCommentCreated(ctx, doer, repo, issue, comment)
95-
}
96-
97-
// CreateCommentAndChangeStatus creates a comment and changes the issue status.
98-
func CreateCommentAndChangeStatus(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, issue *issues_model.Issue, content string, attachments []string) (*issues_model.Comment, error) {
99-
comment, err := CreateIssueComment(ctx, doer, repo, issue, content, attachments)
100-
if err != nil {
101-
return nil, err
95+
if err := notifyCommentCreated(ctx, doer, repo, issue, comment); err != nil {
96+
// If notification fails, we still return the comment but log the error.
97+
log.Error("Failed to notify comment creation: %v", err)
10298
}
10399

104100
return comment, nil

0 commit comments

Comments
 (0)