diff --git a/plugins/webstats/lua/webstats_common.lua b/plugins/webstats/lua/webstats_common.lua index 3571f9c18..5f0511c71 100644 --- a/plugins/webstats/lua/webstats_common.lua +++ b/plugins/webstats/lua/webstats_common.lua @@ -289,6 +289,11 @@ function _M.cron(self) return true end + local cron_key = 'cron_every_1s' + if self:is_working(cron_key) then + return true + end + ngx.update_time() local begin = ngx.now() @@ -330,11 +335,6 @@ function _M.cron(self) end end - local cron_key = 'cron_every_1s' - if self:is_working(cron_key) then - return true - end - self:lock_working(cron_key) -- 每秒100条