Update index.py

This commit is contained in:
midoks 2023-02-11 23:43:51 +08:00
parent 560d482f31
commit e3ecdfb2b3
1 changed files with 9 additions and 7 deletions

View File

@ -254,21 +254,23 @@ def initDreplace():
file_list = [
'webstats_common.lua',
'webstats_log.lua',
'webstats_worker.lua',
]
for fl in file_list:
loadLuaFile(fl)
root_worker_dir = mw.getServerDir() + '/web_conf/nginx/lua/init_worker_by_lua_file'
webstats_worker_src_file = lua_dir = getServerDir() + "/lua/webstats_worker.lua"
webstats_worker_dst_file = root_worker_dir + '/webstats_worker.lua'
content = mw.readFile(webstats_worker_src_file)
content = content.replace('{$SERVER_APP}', getServerDir())
content = content.replace('{$ROOT_PATH}', mw.getServerDir())
mw.writeFile(webstats_worker_dst_file, content)
mw.opLuaInitWorkerFile()
if not os.path.exists(webstats_worker_src_file):
loadLuaFile('webstats_worker.lua')
webstats_worker_src_file = lua_dir = getServerDir() + "/lua/webstats_worker.lua"
content = mw.readFile(webstats_worker_src_file)
content = content.replace('{$SERVER_APP}', getServerDir())
content = content.replace('{$ROOT_PATH}', mw.getServerDir())
mw.writeFile(webstats_worker_dst_file, content)
mw.opLuaInitWorkerFile()
os.remove(webstats_worker_src_file)
loadConfigFile()
loadLuaSiteFile()