From 8e67f35b123cdd53bcaf39a295275ca4e226c419 Mon Sep 17 00:00:00 2001 From: Yiru Wang Mac Date: Mon, 20 Jul 2020 15:20:01 +0800 Subject: [PATCH] http-timeout and harakiri become configurable --- packageship/packageship/package.ini | 8 ++++++-- packageship/packageship/pkgshipd | 11 +++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packageship/packageship/package.ini b/packageship/packageship/package.ini index 46444d84..f21decee 100644 --- a/packageship/packageship/package.ini +++ b/packageship/packageship/package.ini @@ -62,8 +62,12 @@ log_level=INFO log_name=log_info.log [UWSGI] - +; uwsgi log file path daemonize=/var/log/uwsgi.log - +; The data size transferred from back to forth buffer-size=65536 +; HTTP Connection time +http-timeout=600 +; Server response time +harakiri=600 diff --git a/packageship/packageship/pkgshipd b/packageship/packageship/pkgshipd index 92c27a63..80cf8dd0 100755 --- a/packageship/packageship/pkgshipd +++ b/packageship/packageship/pkgshipd @@ -18,13 +18,16 @@ function create_config_file(){ echo "[INFO] config type is: $service" daemonize=$(get_config "$service" "daemonize") buffer_size=$(get_config "$service" "buffer-size") + http_timeout=$(get_config "$service" "http-timeout") + harakiri=$(get_config "$service" "harakiri") wsgi_file_path=$(find /usr/lib/ -name "packageship") if [ $service = "manage" -o $service = "all" ];then write_port=$(get_config "$service" "write_port") write_ip_addr=$(get_config "$service" "write_ip_addr") - if [[ -z "$daemonize" ]] || [[ -z "$buffer_size" ]] || [[ -z "$write_ip_addr" ]] || [[ -z "$write_port" ]];then + if [[ -z "$daemonize" ]] || [[ -z "$buffer_size" ]] || [[ -z "$write_ip_addr" ]] || [[ -z "$http_timeout" ]] || [[ -z "$harakiri" ]] || [[ -z "$write_port" ]]; + then echo "[ERROR] CAN NOT find all config name in: $SYS_PATH/package.ini, Please check the file" - echo "[ERROR] The following config name is needed: daemonize, buffer_size, write_port and write_ip_addr" + echo "[ERROR] The following config name is needed: daemonize, buffer-size, write_port, write_ip_addr, harakiri and http-timeout" exit 1 fi if [ -z "$wsgi_file_path" ];then @@ -39,8 +42,8 @@ wsgi-file=$wsgi_file_path/manage.py callable=app buffer-size=$buffer_size pidfile=$OUT_PATH/manage.pid -http-timeout=600 -harakiri=600 +http-timeout=$http_timeout +harakiri=$harakiri daemonize=$daemonize" > $OUT_PATH/manage.ini fi -- GitLab