修复WAF IP名单测试用例的一个可能异常

This commit is contained in:
刘祥超
2022-09-03 09:56:36 +08:00
parent 305cb4b46e
commit dd1dbd424e

View File

@@ -38,8 +38,10 @@ func TestIPList_Expire(t *testing.T) {
var ticker = time.NewTicker(1 * time.Second) var ticker = time.NewTicker(1 * time.Second)
for range ticker.C { for range ticker.C {
t.Log("====") t.Log("====")
list.locker.Lock()
logs.PrintAsJSON(list.ipMap, t) logs.PrintAsJSON(list.ipMap, t)
logs.PrintAsJSON(list.idMap, t) logs.PrintAsJSON(list.idMap, t)
list.locker.Unlock()
if len(list.idMap) == 0 { if len(list.idMap) == 0 {
break break
} }