mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-03 08:55:20 +02:00
Always reuse transaction (#22362)
This commit is contained in:
parent
d42b52fcfa
commit
6135359a04
11 changed files with 104 additions and 42 deletions
|
@ -300,7 +300,7 @@ func changeProjectStatus(ctx context.Context, p *Project, isClosed bool) error {
|
|||
// DeleteProjectByID deletes a project from a repository. if it's not in a database
|
||||
// transaction, it will start a new database transaction
|
||||
func DeleteProjectByID(ctx context.Context, id int64) error {
|
||||
return db.AutoTx(ctx, func(ctx context.Context) error {
|
||||
return db.WithTx(ctx, func(ctx context.Context) error {
|
||||
p, err := GetProjectByID(ctx, id)
|
||||
if err != nil {
|
||||
if IsErrProjectNotExist(err) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue