Skip to content

Commit

Permalink
adding logs for debugging connection caching
Browse files Browse the repository at this point in the history
  • Loading branch information
enekofb committed Sep 20, 2023
1 parent d97c501 commit 4132380
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/clustersmngr/factory_caches.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,16 @@ func (uc *UsersClients) cacheKey(user *auth.UserPrincipal, clusterName string) u

func (uc *UsersClients) Set(user *auth.UserPrincipal, clusterName string, client client.Client) {
cacheKey := uc.cacheKey(user, clusterName)
uc.log.Info("set cached connection", "user", user, "cluster", clusterName, "cacheKey", cacheKey)
uc.log.Info("set cached connection", "user", user, "cluster", clusterName, "cacheKey", cacheKey, "ttl", usersClientsTTL)

uc.Cache.Set(cacheKey, client, usersClientsTTL)

if _, found := uc.Cache.Get(cacheKey); found {
uc.log.Info("found after set")
} else {
uc.log.Info("not found after set")
}

}

func (uc *UsersClients) Get(user *auth.UserPrincipal, clusterName string) (client.Client, bool) {
Expand Down

0 comments on commit 4132380

Please sign in to comment.