1
0
mirror of https://github.com/FloatTech/zbpdata.git synced 2024-11-17 09:37:14 +09:00

add zbpwife

This commit is contained in:
源文雨 2023-03-25 15:40:09 +08:00
parent 0d0fa3f435
commit dc8f73dee4

View File

@ -13,6 +13,7 @@ import (
"unicode" "unicode"
"unsafe" "unsafe"
"github.com/FloatTech/floatbox/process"
"github.com/fumiama/go-registry" "github.com/fumiama/go-registry"
"github.com/wdvxdr1123/ZeroBot/utils/helper" "github.com/wdvxdr1123/ZeroBot/utils/helper"
) )
@ -45,18 +46,19 @@ func main() {
panic(err) panic(err)
} }
for i, fn := range files { for i, fn := range files {
for c := 0; c < 5; c++ { for c := 0; c < 16; c++ {
err = r.Set("data/"+fn, md5s[i]) err = r.Set("data/"+fn, md5s[i])
fmt.Println("set", "data/"+fn, "=", hex.EncodeToString(helper.StringToBytes(md5s[i]))) fmt.Println("set", "data/"+fn, "=", hex.EncodeToString(helper.StringToBytes(md5s[i])))
if err == nil { if err == nil {
break break
} }
if c >= 4 { if c >= 15 {
panic("ERROR:" + err.Error() + "max retry times exceeded") panic("ERROR:" + err.Error() + ", max retry times exceeded")
} else { } else {
fmt.Println("ERROR:", err, ", retry times:", c) fmt.Println("ERROR:", err, ", retry times:", c)
} }
_ = r.Close() _ = r.Close()
process.SleepAbout1sTo2s()
err = r.Connect() err = r.Connect()
if err != nil { if err != nil {
panic(err) panic(err)