From e852b9d7e37f7435ed69393b327cc5052ede1999 Mon Sep 17 00:00:00 2001 From: Yihao Deng Date: Sat, 22 Jun 2024 22:53:10 +0000 Subject: [PATCH] Need to update version information to prevent frequent fetching of authentication --- source/client/src/clientHb.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/client/src/clientHb.c b/source/client/src/clientHb.c index 790858ef2e..483edcf3f0 100644 --- a/source/client/src/clientHb.c +++ b/source/client/src/clientHb.c @@ -142,6 +142,14 @@ static int32_t hbUpdateUserAuthInfo(SAppHbMgr *pAppHbMgr, SUserAuthBatchRsp *bat tscDebug("update whitelist version of user %s from %" PRId64 " to %" PRId64 ", tscRid:%" PRIi64, pRsp->user, oldVer, atomic_load_64(&whiteListInfo->ver), pTscObj->id); } + } else { + // Need to update version information to prevent frequent fetching of authentication + // information. + SWhiteListInfo *whiteListInfo = &pTscObj->whiteListInfo; + int64_t oldVer = atomic_load_64(&whiteListInfo->ver); + atomic_store_64(&whiteListInfo->ver, pRsp->whiteListVer); + tscDebug("update whitelist version of user %s from %" PRId64 " to %" PRId64 ", tscRid:%" PRIi64, pRsp->user, + oldVer, atomic_load_64(&whiteListInfo->ver), pTscObj->id); } releaseTscObj(pReq->connKey.tscRid); }