- use utils.CallFuncAsync when possible.

This commit is contained in:
gazebo
2018-10-20 12:02:52 +08:00
parent 2308abb775
commit 2bfa5fe17f
4 changed files with 14 additions and 8 deletions

View File

@@ -79,12 +79,12 @@ func RefreshConfig(configKey string, expiresTime time.Duration, configGetter fun
token, err := refreshFunc() // 这样写的目的是强制第一次调用时要刷新一次
if err == nil {
configSetter(token)
go func() {
utils.CallFuncAsync(func() {
for {
time.Sleep(sleepGap)
refreshFunc()
}
}()
})
}
return err
}