From dc8f73dee4305084a9566a78cfeae1904bf92dbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Sat, 25 Mar 2023 15:40:09 +0800 Subject: [PATCH] add zbpwife --- main.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 5a4ebd9..6da76bf 100644 --- a/main.go +++ b/main.go @@ -13,6 +13,7 @@ import ( "unicode" "unsafe" + "github.com/FloatTech/floatbox/process" "github.com/fumiama/go-registry" "github.com/wdvxdr1123/ZeroBot/utils/helper" ) @@ -45,18 +46,19 @@ func main() { panic(err) } for i, fn := range files { - for c := 0; c < 5; c++ { + for c := 0; c < 16; c++ { err = r.Set("data/"+fn, md5s[i]) fmt.Println("set", "data/"+fn, "=", hex.EncodeToString(helper.StringToBytes(md5s[i]))) if err == nil { break } - if c >= 4 { - panic("ERROR:" + err.Error() + "max retry times exceeded") + if c >= 15 { + panic("ERROR:" + err.Error() + ", max retry times exceeded") } else { fmt.Println("ERROR:", err, ", retry times:", c) } _ = r.Close() + process.SleepAbout1sTo2s() err = r.Connect() if err != nil { panic(err)