diff options
author | Jason Song <i@wolfogre.com> | 2023-01-08 09:34:58 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-08 09:34:58 +0800 |
commit | 6135359a049b9d9ab43c5901d4cdadfc45094aa1 (patch) | |
tree | 44ab2b9e7aada00010241141e5d039fe08c8af5f /models/project | |
parent | d42b52fcfa4b175810e8da6bc1a8822838ff6456 (diff) | |
download | gitea-6135359a049b9d9ab43c5901d4cdadfc45094aa1.tar.gz gitea-6135359a049b9d9ab43c5901d4cdadfc45094aa1.zip |
Always reuse transaction (#22362)
Diffstat (limited to 'models/project')
-rw-r--r-- | models/project/project.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/models/project/project.go b/models/project/project.go index 0a07cfe22a..f432d0bc4c 100644 --- a/models/project/project.go +++ b/models/project/project.go @@ -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) { |