Skip to content

Commit 822e407

Browse files
committed
fix: use UpdateRepoIssueNumbers
1 parent 98b8e8c commit 822e407

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

models/issues/issue.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -997,12 +997,7 @@ func NewIssueWithIndex(ctx context.Context, doer *user_model.User, opts NewIssue
997997
}
998998
}
999999

1000-
if opts.IsPull {
1001-
_, err = e.Exec("UPDATE `repository` SET num_pulls = num_pulls + 1 WHERE id = ?", opts.Issue.RepoID)
1002-
} else {
1003-
_, err = e.Exec("UPDATE `repository` SET num_issues = num_issues + 1 WHERE id = ?", opts.Issue.RepoID)
1004-
}
1005-
if err != nil {
1000+
if err := repo_model.UpdateRepoIssueNumbers(ctx, opts.Issue.RepoID, opts.IsPull, false); err != nil {
10061001
return err
10071002
}
10081003

0 commit comments

Comments
 (0)