Skip to content
Permalink
Browse files
Merge pull request #1459 from serverglen/rpc_view
rpc_view support setting timeout
  • Loading branch information
lorinlee committed Jul 5, 2021
2 parents 9716e26 + dd7faed commit 8dc52a7b68aa0f88c1f25f335e4a3388d51d94fe
Showing 1 changed file with 2 additions and 1 deletion.
@@ -24,6 +24,7 @@

DEFINE_int32(port, 8888, "TCP Port of this server");
DEFINE_string(target, "", "The server to view");
DEFINE_int32(timeout_ms, 5000, "Timeout for calling the server to view");

// handle HTTP response of accessing builtin services of the target server.
static void handle_response(brpc::Controller* client_cntl,
@@ -135,7 +136,7 @@ class ViewServiceImpl : public ViewService {
// query "seconds", we set the timeout to be longer than "seconds".
const std::string* seconds =
server_cntl->http_request().uri().GetQuery("seconds");
int64_t timeout_ms = 5000;
int64_t timeout_ms = FLAGS_timeout_ms;
if (seconds) {
timeout_ms += atoll(seconds->c_str()) * 1000;
}

0 comments on commit 8dc52a7

Please sign in to comment.