Pārlūkot izejas kodu

优化启动脚本

Minho 7 gadi atpakaļ
vecāks
revīzija
8d71f2fa7d
2 mainītis faili ar 25 papildinājumiem un 1 dzēšanām
  1. 1 1
      conf/app.conf.example
  2. 24 0
      start.sh

+ 1 - 1
conf/app.conf.example

@@ -115,7 +115,7 @@ cache_memory_interval=120
 #当缓存方式配置为file时,缓存的储存目录
 cache_file_path=./runtime/
 #缓存文件后缀
-cache_file_suffix=
+cache_file_suffix=.bin
 #文件缓存目录层级
 cache_file_dir_level=2
 #文件缓存的默认过期时间

+ 24 - 0
start.sh

@@ -52,6 +52,30 @@ if [ ! -z $CDN ]; then
     sed -i "s#^cdn=.*#cdn=$CDN#g" conf/app.conf
 fi
 
+if [ ! -z $CACHE ]; then
+    sed -i "s#cache=.*#cache=$CACHE#g" conf/app.conf
+fi
+
+if [ ! -z $CACHE_PROVIDER ]; then
+    sed -i "s#cache_provider=.*#cache_provider=$CACHE_PROVIDER#g" conf/app.conf
+fi
+
+if [ ! -z $CACHE_MEMCACHE_HOST ]; then
+    sed -i "s#cache_memcache_host=.*#cache_memcache_host=$CACHE_MEMCACHE_HOST#g" conf/app.conf
+fi
+
+if [ ! -z $CACHE_REDIS_HOST ]; then
+    sed -i "s#cache_redis_host=.*#cache_redis_host=$CACHE_REDIS_HOST#g" conf/app.conf
+fi
+
+if [ ! -z $CACHE_REDIS_DB ]; then
+    sed -i "s#cache_redis_db=.*#cache_redis_db=$CACHE_REDIS_DB#g" conf/app.conf
+fi
+
+if [ ! -z $CACHE_REDIS_PASSWROD ]; then
+    sed -i "s#cache_redis_password=.*#cache_redis_password=$CACHE_REDIS_PASSWROD#g" conf/app.conf
+fi
+
 sed -i 's/^runmode.*/runmode=prod/g' conf/app.conf
 
 /go/src/github.com/lifei6671/mindoc/mindoc_linux_amd64 install