Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beta456 #456

Merged
merged 11 commits into from
Jul 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
beta447
Hoshinonyaruko committed Jun 29, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit a6ebe5722bc90f7c34a253fc479415a91bda3bf2
10 changes: 5 additions & 5 deletions idmap/service.go
Original file line number Diff line number Diff line change
@@ -113,15 +113,15 @@ func CleanBucket(bucketName string) {
return fmt.Errorf("bucket %s not found", bucketName)
}

// 使用游标遍历bucket
// 使用游标遍历bucket 正向键 k:v 32位openid:大宽int64 64位msgid:大宽int6
c := b.Cursor()
for k, v := c.First(); k != nil; k, v = c.Next() {
// 检查键或值是否包含冒号
if bytes.Contains(k, []byte(":")) || bytes.Contains(v, []byte(":")) {
continue // 忽略包含冒号的键值对
}

// 检查值id的长度
// 检查值id的长度 这里是正向键
id := string(k)
if len(id) != 32 {
if err := c.Delete(); err != nil {
@@ -131,14 +131,14 @@ func CleanBucket(bucketName string) {
}
}

// 再次遍历处理reverseKey的情况
// 再次遍历处理reverseKey的情况 反向键 row-整数:string 32位openid/64位msgid
for k, v := c.First(); k != nil; k, v = c.Next() {
if strings.HasPrefix(string(k), "row-") {
if bytes.Contains(k, []byte(":")) || bytes.Contains(v, []byte(":")) {
continue // 忽略包含冒号的键值对
}

id := string(b.Get(k))
// 这里检查反向键是否是32位
id := string(v)
if len(id) != 32 {
if err := b.Delete(k); err != nil {
return err