Update webstats_common.lua

This commit is contained in:
Mr Chen 2023-11-18 04:32:35 +08:00
parent 4b7c821a91
commit afe7175941
1 changed files with 9 additions and 0 deletions

View File

@ -240,6 +240,8 @@ function _M.get_http_origin(self)
end
function _M.cronPre(self)
self:lock_working('cron_init_stat')
local time_key = self:get_store_key()
local time_key_next = self:get_store_key_with_time(ngx.time()+3600)
@ -272,6 +274,8 @@ function _M.cronPre(self)
end
end
self:unlock_working('cron_init_stat')
return true
end
@ -317,6 +321,11 @@ function _M.cron(self)
return true
end
-- 初始化统计表时不执行
if self:is_working('cron_init_stat') then
return true
end
local db = self:initDB(input_sn)
stat_fields[input_sn] = {}