1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-02 16:35:19 +02: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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 {