diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2018-10-25 18:55:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-25 18:55:16 +0800 |
commit | 5f938c0c7870a112aa9ab65b6f4fd1f47eb34f51 (patch) | |
tree | 517927f7777d3aad8ff97c798ab8a6520d714559 /models/org_team.go | |
parent | 554581f84855eda4589a4f66bb560a5ca00e63ff (diff) | |
download | gitea-5f938c0c7870a112aa9ab65b6f4fd1f47eb34f51.tar.gz gitea-5f938c0c7870a112aa9ab65b6f4fd1f47eb34f51.zip |
Fix sqlite lock (#5176)
* fix sqlite lock
* fix sqlite lock on getUnitType
Diffstat (limited to 'models/org_team.go')
-rw-r--r-- | models/org_team.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/models/org_team.go b/models/org_team.go index 3b37f936ff..505f11d39d 100644 --- a/models/org_team.go +++ b/models/org_team.go @@ -215,7 +215,11 @@ func (t *Team) RemoveRepository(repoID int64) error { // UnitEnabled returns if the team has the given unit type enabled func (t *Team) UnitEnabled(tp UnitType) bool { - if err := t.getUnits(x); err != nil { + return t.unitEnabled(x, tp) +} + +func (t *Team) unitEnabled(e Engine, tp UnitType) bool { + if err := t.getUnits(e); err != nil { log.Warn("Error loading repository (ID: %d) units: %s", t.ID, err.Error()) } |