mirror of
https://github.com/go-gitea/gitea
synced 2025-01-10 01:34:43 +00:00
Add transaction for CloseIssue
This commit is contained in:
parent
fdff19948a
commit
6fe35175a7
@ -127,7 +127,20 @@ func CloseIssue(ctx context.Context, issue *Issue, doer *user_model.User) (*Comm
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return changeIssueStatus(ctx, issue, doer, true, false)
|
ctx, committer, err := db.TxContext(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer committer.Close()
|
||||||
|
|
||||||
|
comment, err := changeIssueStatus(ctx, issue, doer, true, false)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if err := committer.Commit(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return comment, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ChangeIssueStatus changes issue status to open or closed.
|
// ChangeIssueStatus changes issue status to open or closed.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user