优化WAF中IP名单

This commit is contained in:
GoEdgeLab
2022-09-03 09:54:25 +08:00
parent a98889d48c
commit 44fdbab99f
4 changed files with 120 additions and 23 deletions

View File

@@ -77,6 +77,12 @@ func (this *List) Remove(itemId uint64) {
this.removeItem(itemId)
}
func (this *List) ExpiresAt(itemId uint64) int64 {
this.locker.Lock()
defer this.locker.Unlock()
return this.itemsMap[itemId]
}
func (this *List) GC(timestamp int64) ItemMap {
if this.lastTimestamp > timestamp+1 {
return nil