v0.4.1
v0.4.0 -> v0.4.1
Summary
Extract shared core struct to enable Session support, add lazy DB replay and parallel compaction for faster startup/shutdown, replace channel-based cancellation with context.Context, support custom storage path via New(path), and sync Expire/Persist changes to JSON cache files.
翻譯
抽離共用 core 結構體支援 Session、新增延遲載入與並行 compact 加速啟動與關閉、以 context.Context 取代 channel 取消機制、支援自訂儲存路徑、修正 Expire/Persist 未同步寫入 JSON 快取檔案。Changes
FEAT
- Add
Sessiontype sharingcoredb routing, allowing independent db index per session - Add custom storage path support via
New(path ...string)with directory validation
翻譯
- 新增
Session類型共用coredb 路由,每個 session 可獨立切換 db index - 透過
New(path ...string)支援自訂儲存路徑,含目錄驗證
FIX
- Sync Expire/ExpireAt/Persist changes to JSON cache files, matching Set/Del behavior
- Remove expired key's JSON cache file in
cleanExpired, consistent withDel
翻譯
- 修正 Expire/ExpireAt/Persist 變更未同步寫入 JSON 快取檔案,與 Set/Del 行為一致
- 清除過期 key 時同步刪除對應 JSON 快取檔案,與 Del 行為一致
REFACTOR
- Extract
corestruct withDB(),Current(),Select()methods shared byStoreandSession - Move all command methods from
*Storereceiver to*corereceiver
翻譯
- 抽離
core結構體,DB()、Current()、Select()供Store與Session共用 - 所有命令方法從
*Storereceiver 遷移至*corereceiver
PERF
- Add lazy DB replay via
sync.Once, only loading AOF on first access instead of all 16 at startup - Parallelize
compact()inClose()using goroutines, reducing shutdown time to slowest single DB - Replace unbuffered
cleanChchannel withcontext.Contextcancellation, eliminating potential deadlock on shutdown
翻譯
- 透過
sync.Once延遲載入 DB,首次存取才 replay AOF,啟動不再掃描全部 16 個 DB Close()中以 goroutine 並行執行compact(),關閉耗時降為最慢單一 DB- 以
context.Context取消機制取代無緩衝 channel,消除關閉時潛在 deadlock
Files Changed
| File | Status | Tag |
|---|---|---|
core/store/store.go |
Modified | FEAT |
core/store/ttl.go |
Modified | FIX |
core/store/exec.go |
Modified | REFACTOR |
core/store/get.go |
Modified | REFACTOR |
core/store/set.go |
Modified | REFACTOR |
core/store/del.go |
Modified | REFACTOR |
core/store/find.go |
Modified | REFACTOR |
core/store/query.go |
Modified | REFACTOR |
core/store/keys.go |
Modified | REFACTOR |
core/store/incr.go |
Modified | REFACTOR |
core/store/incrField.go |
Modified | REFACTOR |
core/store/setField.go |
Modified | REFACTOR |
cmd/test/main.go |
Modified | UPDATE |
Generated by SKILL