master
Evan Chen 2022-01-21 00:59:03 +08:00
parent 43be52795a
commit 1abe1c7476
1 changed files with 3 additions and 3 deletions

View File

@ -82,10 +82,10 @@ func Set(key, value string) error {
return result.Error
}
var load []*func()
var load []func()
var loadLock sync.Mutex
func AddSoftLoad(f *func()) {
func AddSoftLoad(f func()) {
loadLock.Lock()
load = append(load, f)
loadLock.Unlock()
@ -94,7 +94,7 @@ func AddSoftLoad(f *func()) {
func Load() {
for _, f := range load {
if f != nil {
(*f)()
f()
}
}
}