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"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/fs"
|
"io/fs"
|
||||||
"net"
|
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"unicode"
|
"unicode"
|
||||||
@ -58,38 +57,30 @@ func main() {
|
|||||||
*(*unsafe.Pointer)(unsafe.Pointer(&md5s[i])) = unsafe.Pointer(&buf)
|
*(*unsafe.Pointer)(unsafe.Pointer(&md5s[i])) = unsafe.Pointer(&buf)
|
||||||
*(*uintptr)(unsafe.Add(unsafe.Pointer(&md5s[i]), unsafe.Sizeof(uintptr(0)))) = uintptr(16)
|
*(*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 {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
for _, h := range hosts {
|
for i, fn := range files {
|
||||||
fmt.Println("推送到:", h)
|
for c := 0; c < 16; c++ {
|
||||||
r := registry.NewRegedit(net.JoinHostPort(h, "32664"), "", "fumiama", os.Getenv("REILIA_SPS"))
|
err = r.Set("data/"+fn, md5s[i])
|
||||||
err = r.Connect()
|
fmt.Println("set", "data/"+fn, "=", hex.EncodeToString(helper.StringToBytes(md5s[i])))
|
||||||
if err != nil {
|
if err == nil {
|
||||||
fmt.Println(err)
|
break
|
||||||
continue
|
}
|
||||||
}
|
if c >= 15 {
|
||||||
for i, fn := range files {
|
panic("ERROR:" + err.Error() + ", max retry times exceeded")
|
||||||
for c := 0; c < 16; c++ {
|
} else {
|
||||||
err = r.Set("data/"+fn, md5s[i])
|
fmt.Println("ERROR:", err, ", retry times:", c)
|
||||||
fmt.Println("set", "data/"+fn, "=", hex.EncodeToString(helper.StringToBytes(md5s[i])))
|
}
|
||||||
if err == nil {
|
_ = r.Close()
|
||||||
break
|
process.SleepAbout1sTo2s()
|
||||||
}
|
err = r.Connect()
|
||||||
if c >= 15 {
|
if err != nil {
|
||||||
panic("ERROR:" + err.Error() + ", max retry times exceeded")
|
panic(err)
|
||||||
} 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