diff --git a/doc/start_syncer.md b/doc/start_syncer.md index 33d853c3..2a14b4fb 100644 --- a/doc/start_syncer.md +++ b/doc/start_syncer.md @@ -92,7 +92,7 @@ bash bin/start_syncer.sh --commit_txn_timeout 33s ### --connect_timeout duration 用于指定连接超时时间 ```bash -bash bin/start_syncer.sh --connect_timeout_syncer 1s +bash bin/start_syncer.sh --connect_timeout 10s ``` 默认值为1s @@ -106,6 +106,6 @@ bash bin/start_syncer.sh --local_repo_name "repo_name" ### --rpc_timeout duration 用于指定rpc超时时间 ```bash -bash bin/start_syncer.sh --rpc_timeout_duration 3s +bash bin/start_syncer.sh --rpc_timeout 30s ``` 默认值为3s \ No newline at end of file diff --git a/shell/start_syncer.sh b/shell/start_syncer.sh index ef0dc879..4b25a238 100755 --- a/shell/start_syncer.sh +++ b/shell/start_syncer.sh @@ -17,7 +17,7 @@ usage() { echo " Usage: $0 [--daemon] [--log_level [info|debug|trace]] [--log_dir dir] [--db_dir dir] [--host host] [--port port] [--pid_dir dir] [--pprof [true|false]] - [--pprof_port p_port] + [--pprof_port p_port] [--connect_timeout s] [--rpc_timeout s] " exit 1 } @@ -41,6 +41,8 @@ OPTS="$(getopt \ -l 'pid_dir:' \ -l 'pprof:' \ -l 'pprof_port:' \ + -l 'connect_timeout:' \ + -l 'rpc_timeout:' \ -- "$@")" eval set -- "${OPTS}" @@ -57,6 +59,8 @@ DB_USER="" DB_PASSWORD="" PPROF="false" PPROF_PORT="6060" +CONNECT_TIMEOUT="10s" +RPC_TIMEOUT="30s" while true; do case "$1" in -h) @@ -121,6 +125,14 @@ while true; do PPROF_PORT=$2 shift 2 ;; + --connect_timeout) + CONNECT_TIMEOUT=$2 + shift 2 + ;; + --rpc_timeout) + RPC_TIMEOUT=$2 + shift 2 + ;; --) shift break @@ -179,6 +191,8 @@ if [[ "${RUN_DAEMON}" -eq 1 ]]; then "-pprof_port=${PPROF_PORT}" \ "-log_level=${LOG_LEVEL}" \ "-log_filename=${LOG_DIR}" \ + "-connect_timeout=${CONNECT_TIMEOUT}" \ + "-rpc_timeout=${RPC_TIMEOUT}" \ "$@" >>"${LOG_DIR}" 2>&1 ${pidfile} else @@ -193,5 +207,7 @@ else "-port=${PORT}" \ "-pprof=${PPROF}" \ "-pprof_port=${PPROF_PORT}" \ + "-connect_timeout=${CONNECT_TIMEOUT}" \ + "-rpc_timeout=${RPC_TIMEOUT}" \ "-log_level=${LOG_LEVEL}" | tee -a "${LOG_DIR}" fi \ No newline at end of file