mirror of
https://github.com/FloatTech/zbpdata.git
synced 2026-02-16 04:05:54 +09:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
50b189ebad | ||
|
|
ab10aa8a6b | ||
|
|
3b9009e90f | ||
|
|
7d6739a9b7 | ||
|
|
5155c7318a |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -18,4 +18,5 @@ scale
|
|||||||
.vscode
|
.vscode
|
||||||
MockingBird/cache
|
MockingBird/cache
|
||||||
driftbottle
|
driftbottle
|
||||||
job
|
job
|
||||||
|
hyaku
|
||||||
BIN
Fortune/奇异恩典.zip
Normal file
BIN
Fortune/奇异恩典.zip
Normal file
Binary file not shown.
1893
WordCount/stopwords.txt
Normal file
1893
WordCount/stopwords.txt
Normal file
File diff suppressed because it is too large
Load Diff
28
main.go
28
main.go
@@ -10,9 +10,11 @@ import (
|
|||||||
"io/fs"
|
"io/fs"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
"sync"
|
||||||
"unicode"
|
"unicode"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
|
"github.com/FloatTech/zbputils/process"
|
||||||
"github.com/fumiama/go-registry"
|
"github.com/fumiama/go-registry"
|
||||||
"github.com/wdvxdr1123/ZeroBot/utils/helper"
|
"github.com/wdvxdr1123/ZeroBot/utils/helper"
|
||||||
)
|
)
|
||||||
@@ -44,12 +46,26 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
defer r.Close()
|
||||||
|
var wg sync.WaitGroup
|
||||||
|
wg.Add(len(files))
|
||||||
for i, fn := range files {
|
for i, fn := range files {
|
||||||
fmt.Println("set", "data/"+fn, "=", hex.EncodeToString(helper.StringToBytes(md5s[i])))
|
go func(i int, fn string) {
|
||||||
err = r.Set("data/"+fn, md5s[i])
|
defer wg.Done()
|
||||||
if err != nil {
|
for c := 0; c < 5; c++ {
|
||||||
panic(err)
|
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")
|
||||||
|
} else {
|
||||||
|
fmt.Println("ERROR:", err, ", retry times:", c)
|
||||||
|
}
|
||||||
|
process.SleepAbout1sTo2s()
|
||||||
|
}
|
||||||
|
}(i, fn)
|
||||||
}
|
}
|
||||||
r.Close()
|
wg.Wait()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user