mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-02 16:35:19 +02:00
Use for a repo action one database transaction (#19576)
... more context (part of #9307)
This commit is contained in:
parent
730420b6b3
commit
92f139d091
29 changed files with 270 additions and 260 deletions
|
@ -5,6 +5,8 @@
|
|||
package models
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"code.gitea.io/gitea/models/db"
|
||||
user_model "code.gitea.io/gitea/models/user"
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
|
@ -117,12 +119,8 @@ func issueDepExists(e db.Engine, issueID, depID int64) (bool, error) {
|
|||
}
|
||||
|
||||
// IssueNoDependenciesLeft checks if issue can be closed
|
||||
func IssueNoDependenciesLeft(issue *Issue) (bool, error) {
|
||||
return issueNoDependenciesLeft(db.GetEngine(db.DefaultContext), issue)
|
||||
}
|
||||
|
||||
func issueNoDependenciesLeft(e db.Engine, issue *Issue) (bool, error) {
|
||||
exists, err := e.
|
||||
func IssueNoDependenciesLeft(ctx context.Context, issue *Issue) (bool, error) {
|
||||
exists, err := db.GetEngine(ctx).
|
||||
Table("issue_dependency").
|
||||
Select("issue.*").
|
||||
Join("INNER", "issue", "issue.id = issue_dependency.dependency_id").
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue