Skip to content

Commit

Permalink
Don't block the execution when request json results (#3039)
Browse files Browse the repository at this point in the history
  • Loading branch information
yixinglu committed Oct 12, 2021
1 parent 64721f1 commit a9dc5ab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/graph/service/GraphService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ folly::Future<ExecutionResponse> GraphService::future_execute(int64_t sessionId,

folly::Future<std::string> GraphService::future_executeJson(int64_t sessionId,
const std::string& query) {
auto rawResp = future_execute(sessionId, query).get();
auto respJsonObj = rawResp.toJson();
return folly::toJson(respJsonObj);
return future_execute(sessionId, query).thenValue([](ExecutionResponse&& resp) {
return folly::toJson(resp.toJson());
});
}

bool GraphService::auth(const std::string& username, const std::string& password) {
Expand Down

0 comments on commit a9dc5ab

Please sign in to comment.