feat(cloudcommon): add rolecache

rolecache 在原有cache的基础上,使用了 watch
的功能,所以数据的过期时间可以调的高一些,这里使用
roleCacheExpireHours 进行控制,默认设置为24小时。
This commit is contained in:
rainzm
2021-02-18 11:14:58 +08:00
parent f204b5e605
commit f352cf4e31
3 changed files with 299 additions and 0 deletions
+5
View File
@@ -63,6 +63,11 @@ func StartService() {
log.Logger().Panic(err.Error())
}
err = db.RoleCacheManager.StartWatchRoleInKeystone()
if err != nil {
log.Fatalf("unable to StartWatchRoleInKeystone: %v", err)
}
// init notify service
models.NotifyService = rpc.NewSRpcService(opts.SocketFileDir, models.ConfigManager, models.TemplateManager)
models.NotifyService.InitAll()