mirror of
https://github.com/FloatTech/zbpdata.git
synced 2025-01-18 20:20:04 +09:00
fix: push
This commit is contained in:
parent
6df0a6f70b
commit
f2fa48b3d7
16
main.go
16
main.go
@ -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()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user