Skip to content

Commit

Permalink
Use client_idle_timeout_secs as the clientAddrTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Aiee committed Feb 28, 2022
1 parent 81b365f commit d6db366
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/clients/meta/MetaClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2313,8 +2313,6 @@ Status MetaClient::authCheckFromCache(const std::string& account,
"please update the client.",
clientIp.toString()));
}
// clear the key
// clientAddrMap_.erase(clientAddrIt);

folly::rcu_reader guard;
const auto& metadata = *metadata_.load();
Expand Down
6 changes: 4 additions & 2 deletions src/graph/service/GraphService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
namespace nebula {
namespace graph {

const int64_t clientAddrTimeout = 60;
// The default value is 28800 seconds
const int64_t clientAddrTimeout = FLAGS_client_idle_timeout_secs;

Status GraphService::init(std::shared_ptr<folly::IOThreadPoolExecutor> ioExecutor,
const HostAddr& hostAddr) {
Expand Down Expand Up @@ -253,7 +254,8 @@ folly::Future<cpp2::VerifyClientVersionResp> GraphService::future_verifyClientVe
auto clientAddr = HostAddr(peer->getAddressStr(), peer->getPort());

auto ttlTimestamp = time::WallClock::fastNowInSec() + clientAddrTimeout;
metaClient_->getClientAddrMap().insert(clientAddr, ttlTimestamp);
auto clientAddrMap = &metaClient_->getClientAddrMap();
clientAddrMap->insert_or_assign(clientAddr, ttlTimestamp);
return folly::makeFuture<cpp2::VerifyClientVersionResp>(std::move(resp));
}
} // namespace graph
Expand Down

0 comments on commit d6db366

Please sign in to comment.