1
0
mirror of https://github.com/FloatTech/zbpdata.git synced 2026-02-15 11:49:35 +09:00

Compare commits

...

13 Commits

Author SHA1 Message Date
源文雨
7aa2cbd0f5 feat: 改为并行上传 2022-04-17 20:09:05 +08:00
源文雨
fb80a176f0 feat: 改为并行上传 2022-04-17 16:18:12 +08:00
源文雨
50b189ebad feat: 改为并行上传 2022-04-17 16:10:37 +08:00
源文雨
ab10aa8a6b feat: 改为并行上传 2022-04-17 16:03:41 +08:00
himawari
3b9009e90f 添加停用词 (#16) 2022-04-16 20:03:36 +08:00
Kanri
7d6739a9b7 增加运势 奇异恩典 2022-04-03 14:31:18 +08:00
源文雨
5155c7318a 🙈 edit ignore 2022-03-28 16:12:34 +08:00
himawari
cbbc692baf Merge pull request #15 from guohuiyuan/main
:wrench:添加vup数据库
2022-03-27 22:25:48 +08:00
himawari
6a32c29c42 :wrench:添加vup数据库 2022-03-27 22:24:40 +08:00
himawari
6919d2ccb9 Merge pull request #2 from FloatTech/main
👍 合并
2022-03-27 22:20:44 +08:00
源文雨
9fc3ca233b fix release 2022-03-27 14:00:12 +08:00
源文雨
d6efc79f18 add fonts 2022-03-27 13:27:16 +08:00
himawari
7e1b02a21e Merge pull request #1 from FloatTech/main
2022-03-23 20:24:13 +08:00
9 changed files with 1928 additions and 7 deletions

View File

@@ -24,5 +24,6 @@ jobs:
run: |
ls
go mod init updater
sed -i '1,3d' main.go
go mod tidy
go run main.go

3
.gitignore vendored
View File

@@ -18,4 +18,5 @@ scale
.vscode
MockingBird/cache
driftbottle
job
job
hyaku

BIN
Bilibili/bilibili.db Normal file

Binary file not shown.

BIN
Font/Nisi-Regular.ttf Normal file

Binary file not shown.

Binary file not shown.

BIN
Font/zhongmoti.ttf Normal file

Binary file not shown.

BIN
Fortune/奇异恩典.zip Normal file

Binary file not shown.

1893
WordCount/stopwords.txt Normal file

File diff suppressed because it is too large Load Diff

38
main.go
View File

@@ -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()
}