mirror of
https://github.com/FloatTech/zbpdata.git
synced 2026-02-15 11:49:35 +09:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7aa2cbd0f5 | ||
|
|
fb80a176f0 | ||
|
|
50b189ebad | ||
|
|
ab10aa8a6b | ||
|
|
3b9009e90f | ||
|
|
7d6739a9b7 | ||
|
|
5155c7318a | ||
|
|
cbbc692baf | ||
|
|
6a32c29c42 | ||
|
|
6919d2ccb9 | ||
|
|
9fc3ca233b | ||
|
|
d6efc79f18 | ||
|
|
7e1b02a21e | ||
|
|
c6f5b6ed31 | ||
|
|
d09b56779c | ||
|
|
35050b631b | ||
|
|
e084d72e9d |
1
.github/workflows/release.yml
vendored
1
.github/workflows/release.yml
vendored
@@ -24,5 +24,6 @@ jobs:
|
||||
run: |
|
||||
ls
|
||||
go mod init updater
|
||||
sed -i '1,3d' main.go
|
||||
go mod tidy
|
||||
go run main.go
|
||||
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -17,4 +17,6 @@ scale
|
||||
.DS_Store
|
||||
.vscode
|
||||
MockingBird/cache
|
||||
driftbottle
|
||||
driftbottle
|
||||
job
|
||||
hyaku
|
||||
BIN
Bilibili/bilibili.db
Normal file
BIN
Bilibili/bilibili.db
Normal file
Binary file not shown.
BIN
Font/Nisi-Regular.ttf
Normal file
BIN
Font/Nisi-Regular.ttf
Normal file
Binary file not shown.
BIN
Font/VioletEvergardenFont.ttf
Normal file
BIN
Font/VioletEvergardenFont.ttf
Normal file
Binary file not shown.
BIN
Font/zhongmoti.ttf
Normal file
BIN
Font/zhongmoti.ttf
Normal file
Binary file not shown.
BIN
Fortune/奇异恩典.zip
Normal file
BIN
Fortune/奇异恩典.zip
Normal file
Binary file not shown.
BIN
Genshin/Genshin.zip
Normal file
BIN
Genshin/Genshin.zip
Normal file
Binary file not shown.
BIN
Tiangou/tiangou.db
Normal file
BIN
Tiangou/tiangou.db
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
38
main.go
38
main.go
@@ -1,3 +1,6 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -7,9 +10,11 @@ import (
|
||||
"io/fs"
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
"unicode"
|
||||
"unsafe"
|
||||
|
||||
"github.com/FloatTech/zbputils/process"
|
||||
"github.com/fumiama/go-registry"
|
||||
"github.com/wdvxdr1123/ZeroBot/utils/helper"
|
||||
)
|
||||
@@ -41,12 +46,33 @@ func main() {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
for i, fn := range files {
|
||||
fmt.Println("set", "data/"+fn, "=", hex.EncodeToString(helper.StringToBytes(md5s[i])))
|
||||
err = r.Set("data/"+fn, md5s[i])
|
||||
if err != nil {
|
||||
panic(err)
|
||||
defer r.Close()
|
||||
for i := 0; i < 1024; i++ {
|
||||
err = r.Set("__setlock__", "fill")
|
||||
if err == nil {
|
||||
break
|
||||
}
|
||||
fmt.Println("accqiring set lock, retry times:", i)
|
||||
}
|
||||
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])))
|
||||
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)
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user