From b3a0f11a802d70ca3bb620d527a74c4bee09e2c7 Mon Sep 17 00:00:00 2001 From: midoks Date: Sun, 12 Feb 2023 00:44:35 +0800 Subject: [PATCH] up --- plugins/webstats/lua/webstats_common.lua | 4 ++-- plugins/webstats/lua/webstats_worker.lua | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/webstats/lua/webstats_common.lua b/plugins/webstats/lua/webstats_common.lua index 1ba56dcdd..8858a55eb 100644 --- a/plugins/webstats/lua/webstats_common.lua +++ b/plugins/webstats/lua/webstats_common.lua @@ -45,6 +45,7 @@ end function _M.getInstance(self) if rawget(self, "instance") == nil then rawset(self, "instance", self.new()) + self.cron() end assert(self.instance ~= nil) return self.instance @@ -474,8 +475,7 @@ function _M.cron(self) ngx.update_time() -- self:D("PID:"..tostring(ngx.worker.id()).."--【"..tostring(llen).."】, elapsed: " .. tostring(ngx.now() - begin)) end - - ngx.timer.every(1, timer_every_get_data) + ngx.timer.every(0.5, timer_every_get_data) end diff --git a/plugins/webstats/lua/webstats_worker.lua b/plugins/webstats/lua/webstats_worker.lua index 2eda941e6..53a4b0d8c 100644 --- a/plugins/webstats/lua/webstats_worker.lua +++ b/plugins/webstats/lua/webstats_worker.lua @@ -17,5 +17,4 @@ end if ngx.worker.id() == 0 then ngx.timer.every(60, webstats_cron_pre) - WS_C:cron() end \ No newline at end of file