1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-19 16:58:37 +00:00

fix sqlite lock (#5184)

* fix sqlite lock

* fix bug

Co-Authored-By: lunny <xiaolunwen@gmail.com>

* fix bug

Co-Authored-By: lunny <xiaolunwen@gmail.com>
This commit is contained in:
Lunny Xiao
2018-10-27 22:45:24 +08:00
committed by GitHub
parent 99c09dfbfa
commit 2b7c366f64
3 changed files with 17 additions and 5 deletions

View File

@@ -448,7 +448,11 @@ func (repo *Repository) MustGetUnit(tp UnitType) *RepoUnit {
// GetUnit returns a RepoUnit object
func (repo *Repository) GetUnit(tp UnitType) (*RepoUnit, error) {
if err := repo.getUnits(x); err != nil {
return repo.getUnit(x, tp)
}
func (repo *Repository) getUnit(e Engine, tp UnitType) (*RepoUnit, error) {
if err := repo.getUnits(e); err != nil {
return nil, err
}
for _, unit := range repo.Units {