IP名单新增IPv6和所有IP两种类型

This commit is contained in:
刘祥超
2021-02-02 15:25:40 +08:00
parent 2bc3d1f81b
commit 022112a11a
15 changed files with 227 additions and 47 deletions

View File

@@ -3,6 +3,7 @@ package models
import (
_ "github.com/go-sql-driver/mysql"
"github.com/iwind/TeaGo/dbs"
"sync"
"testing"
)
@@ -22,3 +23,23 @@ func TestSysLockerDAO_Lock(t *testing.T) {
}
}
}
func TestSysLocker_Increase(t *testing.T) {
count := 100
wg := sync.WaitGroup{}
wg.Add(count)
for i := 0; i < count; i++ {
go func() {
defer wg.Done()
v, err := NewSysLockerDAO().Increase(nil, "hello", 0)
if err != nil {
t.Fatal(err)
}
t.Log("v:", v)
}()
}
wg.Wait()
t.Log("ok")
}