Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaohaifei committed Feb 14, 2022
1 parent 59f20c9 commit 0f1554f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/graph/service/GraphService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ folly::Future<AuthResponse> GraphService::future_authenticate(const std::string&
return future;
}

if (!sessionManager_->isOutOfConnections()) {
if (sessionManager_->isOutOfConnections()) {
ctx->resp().errorCode = ErrorCode::E_TOO_MANY_CONNECTIONS;
ctx->resp().errorMsg.reset(new std::string("Too many connections in the cluster"));
ctx->finish();
Expand Down
6 changes: 3 additions & 3 deletions src/graph/session/GraphSessionManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ class GraphSessionManager final : public SessionManager<ClientSession> {
folly::Future<StatusOr<std::shared_ptr<ClientSession>>> createSession(
const std::string userName, const std::string clientIp, folly::Executor* runner) override;

// Whether not exceeds the max allowed connections.
// Whether exceeds the max allowed connections.
bool isOutOfConnections() {
if (activeSessions_.size() >= static_cast<uint64_t>(FLAGS_max_allowed_connections)) {
LOG(INFO) << "The sessions of the cluster has more than "
"max_allowed_connections: "
<< FLAGS_max_allowed_connections;
return false;
return true;
}
return true;
return false;
}

// Removes a session from both local and meta server.
Expand Down

0 comments on commit 0f1554f

Please sign in to comment.