From aa614a39c4281781cd77052c01f5747f1e5ad05e Mon Sep 17 00:00:00 2001 From: Atin Mukherjee Date: Fri, 1 Apr 2016 11:50:26 +0530 Subject: cli: Make CLI timeout configurable When number of volumes go high in numbers command like gluster volume status may timeout from CLI since it follows a static timeout value of 120 secs. This patch introduces a flag '--timeout' which can pass a specific time out value for a particular command. Change-Id: I9795b709f27357fe5ee10ba19de8f4c11b63186f Signed-off-by: Atin Mukherjee Reviewed-on: http://review.gluster.org/13882 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Jeff Darcy --- cli/src/cli-cmd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cli/src/cli-cmd.c') diff --git a/cli/src/cli-cmd.c b/cli/src/cli-cmd.c index a1e4e909a0d..8a750414108 100644 --- a/cli/src/cli-cmd.c +++ b/cli/src/cli-cmd.c @@ -48,7 +48,7 @@ cli_cmd_needs_connection (struct cli_cmd_word *word) if (!strcasecmp ("exit", word->word)) return 0; - return CLI_DEFAULT_CONN_TIMEOUT; + return cli_default_conn_timeout; } int @@ -371,9 +371,9 @@ cli_cmd_submit (struct rpc_clnt* rpc, void *req, call_frame_t *frame, if ((GLUSTER_CLI_PROFILE_VOLUME == procnum) || (GLUSTER_CLI_HEAL_VOLUME == procnum) || (GLUSTER_CLI_GANESHA == procnum)) - timeout = CLI_TEN_MINUTES_TIMEOUT; + timeout = cli_ten_minutes_timeout; else - timeout = CLI_DEFAULT_CMD_TIMEOUT; + timeout = cli_default_conn_timeout; cli_cmd_lock (); cmd_sent = 0; -- cgit