打印Map

This commit is contained in:
aixiao 2025-01-17 10:47:56 +08:00
parent 4fd5dbe873
commit 99c1276ff6
2 changed files with 3 additions and 3 deletions

BIN
denyip

Binary file not shown.

View File

@ -223,13 +223,14 @@ func runMainProcess() { // 主进程逻辑
next:
IpMutex.Unlock() // 解锁互斥锁
log.Printf(" 当前Ip链表长度:%d, Ipset名:%s, 长:%d, ProcessedIPMap当前长度:%d\n", IpList.Len(), IPSET_NAME, func() int { // 打印 当前 Ipset 链长度
// 打印当前info
log.Printf(" 当前Ip链表长度:%d, Ipset名:%s, 长:%d, ProcessedIPMap:[%s]当前长度:%d\n", IpList.Len(), IPSET_NAME, func() int { // 打印 当前 Ipset 链长度
_len, _err := NumIPSet(IPSET_NAME)
if _err == nil {
return _len
}
return 0
}(), len(ProcessedIPMap))
}(), ProcessedIPMap, len(ProcessedIPMap))
// 清理 ProcessedIPMap
if len(ProcessedIPMap) >= 1024 {
@ -237,7 +238,6 @@ func runMainProcess() { // 主进程逻辑
ProcessedIPMap = make(map[string]struct{}) // 创建一个新的空 map
ProcessedMutex.Unlock() // 解锁
log.Println("ProcessedIPMap 已清空")
}
time.Sleep(1 * time.Second) // 防止高频运行