1
0
Fork 0
forked from forgejo/forgejo

Always reuse transaction (#22362)

This commit is contained in:
Jason Song 2023-01-08 09:34:58 +08:00 committed by GitHub
parent d42b52fcfa
commit 6135359a04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 104 additions and 42 deletions

View file

@ -2365,7 +2365,7 @@ func CountOrphanedIssues(ctx context.Context) (int64, error) {
// DeleteOrphanedIssues delete issues without a repo
func DeleteOrphanedIssues(ctx context.Context) error {
var attachmentPaths []string
err := db.AutoTx(ctx, func(ctx context.Context) error {
err := db.WithTx(ctx, func(ctx context.Context) error {
var ids []int64
if err := db.GetEngine(ctx).Table("issue").Distinct("issue.repo_id").