diff --git a/server/analyseapi/riskmgr.go b/server/analyseapi/riskmgr.go index 19efa6e..84f1c74 100644 --- a/server/analyseapi/riskmgr.go +++ b/server/analyseapi/riskmgr.go @@ -114,16 +114,16 @@ func (this* RiskMgr) UnInit() { func (this* RiskMgr) OutputLog() { f5.SysLog().Info("passobj %s", this.GetPassObj().ToJsonStr()) f5.SysLog().Info("blockobj %s", this.GetBlockObj().ToJsonStr()) - this.passTimes = 0 - this.blockTimes = 0 - this.ipWhiteListPassTimes = 0 - this.launchWhiteListPassTimes = 0 - this.safeZonePassTimes = 0 - this.httpMethodBlockTimes = 0 - this.sessionErrBlockTimes = 0 - this.ipBlackListBlockTimes = 0 - this.launchBlackListBlockTimes = 0 - this.unSafeZoneBlockTimes = 0 + atomic.StoreInt64(&this.passTimes, 0) + atomic.StoreInt64(&this.blockTimes, 0) + atomic.StoreInt64(&this.ipWhiteListPassTimes, 0) + atomic.StoreInt64(&this.launchWhiteListPassTimes, 0) + atomic.StoreInt64(&this.safeZonePassTimes, 0) + atomic.StoreInt64(&this.httpMethodBlockTimes, 0) + atomic.StoreInt64(&this.sessionErrBlockTimes, 0) + atomic.StoreInt64(&this.ipBlackListBlockTimes, 0) + atomic.StoreInt64(&this.launchBlackListBlockTimes, 0) + atomic.StoreInt64(&this.unSafeZoneBlockTimes, 0) } func (this* RiskMgr) InIpWhiteList(ip string) bool {