update
parent
43be52795a
commit
1abe1c7476
|
@ -82,10 +82,10 @@ func Set(key, value string) error {
|
||||||
return result.Error
|
return result.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
var load []*func()
|
var load []func()
|
||||||
var loadLock sync.Mutex
|
var loadLock sync.Mutex
|
||||||
|
|
||||||
func AddSoftLoad(f *func()) {
|
func AddSoftLoad(f func()) {
|
||||||
loadLock.Lock()
|
loadLock.Lock()
|
||||||
load = append(load, f)
|
load = append(load, f)
|
||||||
loadLock.Unlock()
|
loadLock.Unlock()
|
||||||
|
@ -94,7 +94,7 @@ func AddSoftLoad(f *func()) {
|
||||||
func Load() {
|
func Load() {
|
||||||
for _, f := range load {
|
for _, f := range load {
|
||||||
if f != nil {
|
if f != nil {
|
||||||
(*f)()
|
f()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue