mirror of
https://github.com/FloatTech/zbpdata.git
synced 2025-06-28 23:47:46 +09:00
Compare commits
No commits in common. "4f751a1cda692b5b8cb909ce1376a3a0ea0d57cc" and "ca3652920a2be63314adc32dc4b78ff7f2be4aff" have entirely different histories.
4f751a1cda
...
ca3652920a
49
main.go
49
main.go
@ -9,7 +9,6 @@ import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"net"
|
||||
"os"
|
||||
"strings"
|
||||
"unicode"
|
||||
@ -58,38 +57,30 @@ func main() {
|
||||
*(*unsafe.Pointer)(unsafe.Pointer(&md5s[i])) = unsafe.Pointer(&buf)
|
||||
*(*uintptr)(unsafe.Add(unsafe.Pointer(&md5s[i]), unsafe.Sizeof(uintptr(0)))) = uintptr(16)
|
||||
}
|
||||
hosts, err := net.LookupHost("reilia.fumiama.top")
|
||||
r := registry.NewRegedit("reilia.fumiama.top:32664", "", "fumiama", os.Getenv("REILIA_SPS"))
|
||||
err = r.Connect()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
for _, h := range hosts {
|
||||
fmt.Println("推送到:", h)
|
||||
r := registry.NewRegedit(net.JoinHostPort(h, "32664"), "", "fumiama", os.Getenv("REILIA_SPS"))
|
||||
err = r.Connect()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
continue
|
||||
}
|
||||
for i, fn := range files {
|
||||
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 >= 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)
|
||||
}
|
||||
for i, fn := range files {
|
||||
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 >= 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)
|
||||
}
|
||||
}
|
||||
_ = r.Close()
|
||||
}
|
||||
_ = r.Close()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user