From 45e9f71a3f9f5a8784e398d502cb884e6fc5a2b3 Mon Sep 17 00:00:00 2001 From: Hoang Date: Thu, 11 Nov 2021 16:58:44 +0700 Subject: [PATCH] fix comment again --- cache/cache.go | 6 +++--- cache/role.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cache/cache.go b/cache/cache.go index c487d03..5f51ac5 100644 --- a/cache/cache.go +++ b/cache/cache.go @@ -7,7 +7,7 @@ import ( "github.com/allegro/bigcache/v3" ) -var cache *bigcache.BigCache +var mc *bigcache.BigCache // Init ... func Init() { @@ -17,7 +17,7 @@ func Init() { if err != nil { log.Fatalf("Cannot init Cache %v", err) } - cache = c + mc = c // Cache roles Roles() @@ -25,5 +25,5 @@ func Init() { // GetInstance ... func GetInstance() *bigcache.BigCache { - return cache + return mc } diff --git a/cache/role.go b/cache/role.go index b4908d2..7f08d5e 100644 --- a/cache/role.go +++ b/cache/role.go @@ -40,7 +40,7 @@ func Roles() { IsAdmin: role.IsAdmin, Permissions: rolePermissions, }) - if err := cache.Set(role.ID.Hex(), entry); err != nil { + if err := mc.Set(role.ID.Hex(), entry); err != nil { logger.Error("usermngmt - CacheRole", logger.LogData{ "err": err.Error(), }) @@ -55,10 +55,10 @@ func Roles() { // GetCachedRole ... func GetCachedRole(key string) CachedRole { - entry, err := cache.Get(key) + entry, err := mc.Get(key) if err != nil { Roles() - entry, _ = cache.Get(key) + entry, _ = mc.Get(key) } var cachedRole CachedRole if err = json.Unmarshal(entry, &cachedRole); err != nil {