From 70fe2c910be6c02f71c9a6472621b15092644b1f Mon Sep 17 00:00:00 2001 From: jiahui Date: Wed, 11 Mar 2026 18:23:54 +0800 Subject: [PATCH] remove cache --- controllers/account/api/v1/debt_webhook.go | 4 ++-- controllers/pkg/database/cockroach/accountv2.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/account/api/v1/debt_webhook.go b/controllers/account/api/v1/debt_webhook.go index 5382ad0d8da5..ac5f277cb50b 100644 --- a/controllers/account/api/v1/debt_webhook.go +++ b/controllers/account/api/v1/debt_webhook.go @@ -203,7 +203,7 @@ func (d *DebtValidate) checkOption( code.MessageFormat, code.InsufficientBalance, fmt.Sprintf( - "account balance less than 0, now account is %.2f¥. Please recharge the user %s.", + "(cache) account balance less than 0, now account is %.2f¥. Please recharge the user %s.", GetAccountDebtBalance(cachedAccount), user, ), @@ -235,7 +235,7 @@ func (d *DebtValidate) checkOption( } } else { // Cache miss, query database - userUID, err := d.AccountV2.GetUserUID(&pkgtype.UserQueryOpts{Owner: user}) + userUID, err := d.AccountV2.GetUserUID(&pkgtype.UserQueryOpts{Owner: user, WithOutCache: true}) if err != nil { logger.Error(err, "get user error", "user", user) return admission.ValidationResponse(true, err.Error()) diff --git a/controllers/pkg/database/cockroach/accountv2.go b/controllers/pkg/database/cockroach/accountv2.go index b570f15af326..092f51246b18 100644 --- a/controllers/pkg/database/cockroach/accountv2.go +++ b/controllers/pkg/database/cockroach/accountv2.go @@ -503,7 +503,7 @@ func (c *Cockroach) GetUserUID(ops *types.UserQueryOpts) (uid uuid.UUID, err err } // data in the cache owner is preferred if ops.Owner != "" { - uid, err = c.getUserUIDByOwnerWithCache(ops.Owner) + uid, err = c.getUserUIDByOwner(ops.Owner) } else { uid, err = c.getUserUIDByID(ops.ID) }