mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
网站统计 x20
This commit is contained in:
@@ -137,15 +137,13 @@ def loadDebugLogFile():
|
||||
mw.writeFile(debug_log, '')
|
||||
|
||||
|
||||
def pSqliteDb(dbname='web_logs', site_name='unset'):
|
||||
def pSqliteDb(dbname='web_logs', site_name='unset', name="logs"):
|
||||
|
||||
db_dir = getServerDir() + '/logs/' + site_name
|
||||
if not os.path.exists(db_dir):
|
||||
mw.execShell('mkdir -p ' + db_dir)
|
||||
|
||||
name = 'logs'
|
||||
file = db_dir + '/' + name + '.db'
|
||||
|
||||
if not os.path.exists(file):
|
||||
conn = mw.M(dbname).dbPos(db_dir, name)
|
||||
sql = mw.readFile(getPluginDir() + '/conf/init.sql')
|
||||
|
||||
@@ -202,6 +202,13 @@ log_by_lua_block {
|
||||
return json.encode(headers)
|
||||
end
|
||||
|
||||
local function is_migrating(input_server_name)
|
||||
local file = io.open("{$SERVER_APP}/migrating", "rb")
|
||||
if file then return true end
|
||||
local file = io.open("{$SERVER_APP}/logs/"..input_server_name.."/migrating", "rb")
|
||||
if file then return true end
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
local function is_working(name)
|
||||
@@ -837,6 +844,10 @@ log_by_lua_block {
|
||||
end
|
||||
|
||||
local function store_logs(input_server_name)
|
||||
if is_migrating(input_server_name) == true then
|
||||
-- D("migrating...")
|
||||
return
|
||||
end
|
||||
|
||||
local last_insert_id_key = input_server_name.."_last_id"
|
||||
local store_start_id_key = input_server_name.."_store_start"
|
||||
|
||||
Reference in New Issue
Block a user