Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cangfengzhs committed Jan 6, 2022
1 parent 0a60c71 commit 7081904
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/clients/meta/MetaClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,11 @@ bool MetaClient::loadUsersAndRoles() {
// Remove expired users from cache
auto removeExpiredUser = [&](folly::ConcurrentHashMap<std::string, uint32>& userMap,
const std::unordered_set<std::string>& userList) {
for (auto& ele : userMap) {
if (userList.count(ele.first) == 0) {
userMap.erase(ele.first);
for (auto iter = userMap.begin(); iter != userMap.end();) {
if (!userList.count(iter->first)) {
iter = userMap.erase(iter);
} else {
++iter;
}
}
};
Expand Down

0 comments on commit 7081904

Please sign in to comment.