mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-25 11:22:16 +00:00
Prevent deadlock in create issue (#17970)
This commit is contained in:
parent
39eb82446c
commit
eba07867ef
3 changed files with 11 additions and 5 deletions
|
@ -312,10 +312,11 @@ func (repo *Repository) MustGetUnit(tp unit.Type) *RepoUnit {
|
|||
|
||||
// GetUnit returns a RepoUnit object
|
||||
func (repo *Repository) GetUnit(tp unit.Type) (*RepoUnit, error) {
|
||||
return repo.getUnit(db.DefaultContext, tp)
|
||||
return repo.GetUnitCtx(db.DefaultContext, tp)
|
||||
}
|
||||
|
||||
func (repo *Repository) getUnit(ctx context.Context, tp unit.Type) (*RepoUnit, error) {
|
||||
// GetUnitCtx returns a RepoUnit object
|
||||
func (repo *Repository) GetUnitCtx(ctx context.Context, tp unit.Type) (*RepoUnit, error) {
|
||||
if err := repo.LoadUnits(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue