mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 06:00:55 +00:00
fix orm datarace
This commit is contained in:
parent
1b6edafc96
commit
394a73c75f
@ -335,11 +335,11 @@ func RegisterModelWithSuffix(suffix string, models ...interface{}) {
|
||||
// BootStrap bootstrap models.
|
||||
// make all model parsed and can not add more models
|
||||
func BootStrap() {
|
||||
modelCache.Lock()
|
||||
defer modelCache.Unlock()
|
||||
if modelCache.done {
|
||||
return
|
||||
}
|
||||
modelCache.Lock()
|
||||
defer modelCache.Unlock()
|
||||
bootStrap()
|
||||
modelCache.done = true
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user