Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwener committed Feb 9, 2022
1 parent faea1b0 commit d5be5f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/graph/service/GraphService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ folly::Future<AuthResponse> GraphService::future_authenticate(const std::string&

if (!sessionManager_->isOutOfConnections()) {
ctx->resp().errorCode = ErrorCode::E_TOO_MANY_CONNECTIONS;
ctx->resp().errorMsg = std::make_unique<std::string>("Too many connections in the cluster");
ctx->resp().errorMsg.reset(new std::string("Too many connections in the cluster"));
ctx->finish();
stats::StatsManager::addValue(kNumAuthFailedSessions);
stats::StatsManager::addValue(kNumAuthFailedSessionsOutOfMaxAllowed);
Expand All @@ -96,24 +96,24 @@ folly::Future<AuthResponse> GraphService::future_authenticate(const std::string&
LOG(ERROR) << "Create session for userName: " << user << ", ip: " << cIp
<< " failed: " << ret.status();
ctx->resp().errorCode = ErrorCode::E_SESSION_INVALID;
ctx->resp().errorMsg = std::make_unique<std::string>(ret.status().toString());
ctx->resp().errorMsg.reset(new std::string("Get session for sessionId is nullptr"));
return ctx->finish();
}
auto sessionPtr = std::move(ret).value();
if (sessionPtr == nullptr) {
LOG(ERROR) << "Get session for sessionId is nullptr";
ctx->resp().errorCode = ErrorCode::E_SESSION_INVALID;
ctx->resp().errorMsg = std::make_unique<std::string>("Get session for sessionId is nullptr");
ctx->resp().errorMsg.reset(new std::string("Get session for sessionId is nullptr"));
return ctx->finish();
}
stats::StatsManager::addValue(kNumOpenedSessions);
stats::StatsManager::addValue(kNumActiveSessions);
ctx->setSession(sessionPtr);
ctx->resp().sessionId = std::make_unique<int64_t>(ctx->session()->id());
ctx->resp().timeZoneOffsetSeconds =
std::make_unique<int32_t>(time::Timezone::getGlobalTimezone().utcOffsetSecs());
ctx->resp().timeZoneName =
std::make_unique<std::string>(time::Timezone::getGlobalTimezone().stdZoneName());
ctx->resp().sessionId.reset(new int64_t(ctx->session()->id()));
ctx->resp().timeZoneOffsetSeconds.reset(
new int32_t(time::Timezone::getGlobalTimezone().utcOffsetSecs()));
ctx->resp().timeZoneName.reset(
new std::string(time::Timezone::getGlobalTimezone().stdZoneName()));
return ctx->finish();
};

Expand Down
2 changes: 1 addition & 1 deletion src/graph/service/QueryInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class QueryInstance final : public cpp::NonCopyable, public cpp::NonMovable {
explicit QueryInstance(std::unique_ptr<QueryContext> qctx, opt::Optimizer* optimizer);
~QueryInstance() = default;

// entrance of the Validate, Optimize, Schedule, Execute process
// Entrance of the Validate, Optimize, Schedule, Execute process
void execute();

QueryContext* qctx() const {
Expand Down

0 comments on commit d5be5f6

Please sign in to comment.