Skip to content

Commit

Permalink
Code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Shakyan Kushwaha authored and Shakyan Kushwaha committed Oct 7, 2024
1 parent cc0a389 commit a6bbcb4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions presto-native-execution/presto_cpp/main/PrestoServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1414,10 +1414,7 @@ void PrestoServer::reportNodeStatus(proxygen::ResponseHandler* downstream) {
}

void PrestoServer::handleGracefulShutdown(const std::vector<std::unique_ptr<folly::IOBuf>>& body, proxygen::ResponseHandler* downstream){
auto requestBody = body[0]->moveToFbString();
// Remove the trailing newline characters from the requestBody
requestBody.erase(requestBody.length()-2);
if (body.size()==1 && requestBody == "\"SHUTTING_DOWN\"") {
if (body.size()==1 && body[0]->moveToFbString() == "\"SHUTTING_DOWN\"") {
// Print message and initiate shutdown
LOG(INFO) << "Shutdown requested";
if (nodeState() == NodeState::kActive) {
Expand Down

0 comments on commit a6bbcb4

Please sign in to comment.