pull/368/head
midoks 2 years ago
parent b3a0f11a80
commit c0c67095be
  1. 8
      plugins/op_waf/waf/lua/waf_common.lua
  2. 15
      plugins/webstats/lua/webstats_common.lua
  3. 1
      plugins/webstats/lua/webstats_worker.lua

@ -41,6 +41,14 @@ function _M.new(self)
end
-- function _M.getInstance(self)
-- if rawget(self, "instance") == nil then
-- rawset(self, "instance", self.new())
-- end
-- assert(self.instance ~= nil)
-- return self.instance
-- end
function _M.getInstance(self)
if self.instance == nil then
self.instance = self:new()

@ -42,10 +42,19 @@ function _M.new(self)
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
-- end
function _M.getInstance(self)
if rawget(self, "instance") == nil then
rawset(self, "instance", self.new())
self.cron()
if self.instance == nil then
self.instance = self:new()
end
assert(self.instance ~= nil)
return self.instance

@ -17,4 +17,5 @@ end
if ngx.worker.id() == 0 then
ngx.timer.every(60, webstats_cron_pre)
WS_C:cron()
end
Loading…
Cancel
Save