mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 04:19:26 +08:00
up
This commit is contained in:
@@ -655,9 +655,9 @@ def setCcConf():
|
||||
tmp = cobj['cc']
|
||||
|
||||
|
||||
tmp['cycle'] = args['cycle']
|
||||
tmp['limit'] = args['limit']
|
||||
tmp['endtime'] = args['endtime']
|
||||
tmp['cycle'] = int(args['cycle'])
|
||||
tmp['limit'] = int(args['limit'])
|
||||
tmp['endtime'] = int(args['endtime'])
|
||||
tmp['is_open_global'] = args['is_open_global']
|
||||
tmp['increase'] = args['increase']
|
||||
cobj['cc'] = tmp
|
||||
|
||||
@@ -126,6 +126,17 @@ end
|
||||
|
||||
|
||||
function _M.write_file(self, filename, body)
|
||||
fp = io.open(filename,'ab')
|
||||
if fp == nil then
|
||||
return nil
|
||||
end
|
||||
fp:write(body)
|
||||
fp:flush()
|
||||
fp:close()
|
||||
return true
|
||||
end
|
||||
|
||||
function _M.write_file_clear(self, filename, body)
|
||||
fp = io.open(filename,'w')
|
||||
if fp == nil then
|
||||
return nil
|
||||
@@ -245,7 +256,7 @@ function _M.inc_log(self, name, rule)
|
||||
if not total_log then return false end
|
||||
ngx.shared.limit:set(total_path,total_log)
|
||||
if not ngx.shared.limit:get('mw_waf_timeout') then
|
||||
self:write_file(total_path,total_log)
|
||||
self:write_file_clear(total_path,total_log)
|
||||
ngx.shared.limit:set('mw_waf_timeout',1,5)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user