1
0
mirror of https://github.com/FloatTech/zbpdata.git synced 2026-02-16 04:05:54 +09:00

Compare commits

...

2 Commits

Author SHA1 Message Date
himawari
291200d5d4 添加文静示例音频 (#20)
*  添加文静示例音频
2022-05-10 01:04:11 +08:00
源文雨
f2fa48b3d7 fix: push 2022-05-04 20:26:05 +08:00
2 changed files with 17 additions and 21 deletions

BIN
MockingBird/wj.wav Normal file

Binary file not shown.

16
main.go
View File

@@ -10,11 +10,9 @@ import (
"io/fs"
"os"
"strings"
"sync"
"unicode"
"unsafe"
"github.com/FloatTech/zbputils/process"
"github.com/fumiama/go-registry"
"github.com/wdvxdr1123/ZeroBot/utils/helper"
)
@@ -46,12 +44,7 @@ func main() {
if err != nil {
panic(err)
}
defer r.Close()
var wg sync.WaitGroup
wg.Add(len(files))
for i, fn := range files {
go func(i int, fn string) {
defer wg.Done()
for c := 0; c < 5; c++ {
err = r.Set("data/"+fn, md5s[i])
fmt.Println("set", "data/"+fn, "=", hex.EncodeToString(helper.StringToBytes(md5s[i])))
@@ -63,9 +56,12 @@ func main() {
} else {
fmt.Println("ERROR:", err, ", retry times:", c)
}
process.SleepAbout1sTo2s()
_ = r.Close()
err = r.Connect()
if err != nil {
panic(err)
}
}(i, fn)
}
wg.Wait()
}
_ = r.Close()
}