mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-27 01:50:31 +08:00
IP名单新增IPv6和所有IP两种类型
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user