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

UserDbReg : add db_pool_ #320

Merged
merged 2 commits into from
Mar 8, 2024
Merged

UserDbReg : add db_pool_ #320

merged 2 commits into from
Mar 8, 2024

Conversation

shewer
Copy link
Contributor

@shewer shewer commented Feb 28, 2024

  • 增加 db_pool_ ,以便於共享 db 以及 解決leveldb 重覆開啓問題
  • db_class 增加 "tabledb" "stabledb" ( 原來支援 "userdb", "plain_userdb")
    userdb user_dict leveldb file_name name.userdb
    plain_userdb user_dict text file_name name.userdb.txt

tabledb user_dict 可增刪 字典及權重 file_name :name.txt
stabledb user_dict 類似唯讀的 tabledb file_name :name.txt (read_only)

Signed-off-by: shewer <shewer@gmail.com>
@hchunhui
Copy link
Owner

hchunhui commented Mar 2, 2024

代码看起来没问题。需要确认一下:UserDb 是否有对同一个db开启多次的需求?现有的脚本是否可能受到影响?

Signed-off-by: shewer <shewer@gmail.com>
@shewer
Copy link
Contributor Author

shewer commented Mar 2, 2024

代码看起来没问题。需要确认一下:UserDb 是否有对同一个db开启多次的需求?现有的脚本是否可能受到影响?

使用 static db_pool_ 無法移除 己開啓db ,不確定 close() 是否會釋放內存 ,改用 lua script 製作 db_pool_

text db 是載入內存可能發生寫入不同步的問題
多個獨立 translator 如果開啓相同的字典 ,可節省內存 和解決不同步問題

tabledb 可以lua script 轉制 user_dict

@hchunhui hchunhui merged commit 7404699 into hchunhui:master Mar 8, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants