mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 02:21:59 +00:00
Revert unnecessary improving in ContextAccessCache for now.
This commit is contained in:
parent
815a3857de
commit
2379d8c9d5
@ -71,7 +71,6 @@ public:
|
||||
explicit ContextAccessCache(const AccessControl & access_control_) : access_control(access_control_) {}
|
||||
|
||||
std::shared_ptr<const ContextAccess> getContextAccess(const ContextAccessParams & params)
|
||||
{
|
||||
{
|
||||
std::lock_guard lock{mutex};
|
||||
auto x = cache.get(params);
|
||||
@ -82,16 +81,11 @@ public:
|
||||
else
|
||||
return *x;
|
||||
}
|
||||
}
|
||||
|
||||
/// TODO: There is no need to keep the `ContextAccessCache::mutex` locked while we're calculating access rights.
|
||||
auto res = std::make_shared<ContextAccess>(access_control, params);
|
||||
res->initialize();
|
||||
|
||||
{
|
||||
std::lock_guard lock{mutex};
|
||||
cache.add(params, res);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user