瀏覽代碼

HUE-9196 [docker] Run serially hue command: supervisor based wrapper script command (#1066)

(cherry picked from commit aa42895400aef794286f7443b95484d991878c73)
Prakash Ranade 5 年之前
父節點
當前提交
3129828010
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      tools/container/hue/hue.sh

+ 4 - 1
tools/container/hue/hue.sh

@@ -11,9 +11,12 @@ export PYTHON_EGG_CACHE=$HUE_CONF_DIR/.python-eggs
 export SERVER_SOFTWARE="apache"
 
 function prepare_huedb() {
+  (
+  flock -x 124
   $HUE_BIN/hue syncdb --noinput
   $HUE_BIN/hue makemigrations --noinput --merge
   $HUE_BIN/hue migrate
+  ) 124>$HUE_CONF_DIR/hue.lock
 }
 
 function db_connectivity_check() {
@@ -46,7 +49,7 @@ if [[ $ret == "fail" ]];  then
   exit 1
 fi
 
-# prepare db schema
+# prepare db schema, run it in single instance flock mode
 prepare_huedb
 
 if [[ $1 == kt_renewer ]]; then