diff --git a/plugins/sphinx/index.py b/plugins/sphinx/index.py index d4a73e6e2..d3738699d 100755 --- a/plugins/sphinx/index.py +++ b/plugins/sphinx/index.py @@ -210,9 +210,10 @@ def reload(): def rebuild(): file = initDreplace() - subprocess.Popen(file + ' rebuild &', - stdout=subprocess.PIPE, shell=True) - # data = mw.execShell(file + ' rebuild') + cmd = file + ' rebuild &' + data = mw.execShell(cmd) + if data[1] != '': + return data[0] return 'ok' diff --git a/plugins/sphinx/init.d/sphinx.tpl b/plugins/sphinx/init.d/sphinx.tpl index 4652aa078..8de34003c 100644 --- a/plugins/sphinx/init.d/sphinx.tpl +++ b/plugins/sphinx/init.d/sphinx.tpl @@ -33,7 +33,7 @@ start () { } rebuild () { - ${APP_PATH}/bin/bin/indexer -c ${APP_CONF} --all --rotate & + ${APP_PATH}/bin/bin/indexer -c ${APP_CONF} --all --rotate } diff --git a/plugins/sphinx/install.sh b/plugins/sphinx/install.sh index b6a0494f6..9bddb2904 100755 --- a/plugins/sphinx/install.sh +++ b/plugins/sphinx/install.sh @@ -10,6 +10,8 @@ sysName=`uname` install_tmp=${rootPath}/tmp/mw_install.pl +# cd /www/server/mdserver-web && source bin/activate && python3 plugins/sphinx/index.py rebuild + bash ${rootPath}/scripts/getos.sh OSNAME=`cat ${rootPath}/data/osname.pl` diff --git a/plugins/sphinx/js/sphinx.js b/plugins/sphinx/js/sphinx.js index bacda023a..37b7c3e01 100755 --- a/plugins/sphinx/js/sphinx.js +++ b/plugins/sphinx/js/sphinx.js @@ -38,7 +38,7 @@ function rebuild(){ function rebuildIndex(){ spPost('rebuild', '', function(data){ if (data.data == 'ok'){ - layer.msg('在重建中..',{icon:1,time:2000,shade: [0.3, '#000']}); + layer.msg('重建成功!',{icon:1,time:2000,shade: [0.3, '#000']}); } else { layer.msg(data.data,{icon:2,time:2000,shade: [0.3, '#000']}); }