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

refactor(storage): BuntDB initialization and locking mechanism #781

Merged
merged 1 commit into from
Jun 16, 2024

Conversation

appleboy
Copy link
Owner

  • Update github.com/tidwall/buntdb dependency from v1.3.0 to v1.3.1
  • Modify buntdb.New initialization to use conf.Stat.BuntDB.Path
  • Remove explicit lock field in Storage struct and use embedded sync.RWMutex
  • Change lock usage in Storage methods to use embedded sync.RWMutex methods
  • Add os package import in buntdb.go
  • Refactor New function in buntdb.go to accept dbPath string instead of config
  • Update Init method in buntdb.go to handle empty dbPath by setting it to a temporary directory
  • Remove os and config imports from buntdb_test.go
  • Simplify TestBuntDBEngine by removing configuration loading and file existence checks
  • Add test steps to reset and verify the value of a key in TestBuntDBEngine

- Update `github.com/tidwall/buntdb` dependency from v1.3.0 to v1.3.1
- Modify `buntdb.New` initialization to use `conf.Stat.BuntDB.Path`
- Remove explicit lock field in `Storage` struct and use embedded `sync.RWMutex`
- Change lock usage in `Storage` methods to use embedded `sync.RWMutex` methods
- Add `os` package import in `buntdb.go`
- Refactor `New` function in `buntdb.go` to accept `dbPath` string instead of `config`
- Update `Init` method in `buntdb.go` to handle empty `dbPath` by setting it to a temporary directory
- Remove `os` and `config` imports from `buntdb_test.go`
- Simplify `TestBuntDBEngine` by removing configuration loading and file existence checks
- Add test steps to reset and verify the value of a key in `TestBuntDBEngine`

Signed-off-by: appleboy <appleboy.tw@gmail.com>
@appleboy appleboy merged commit d131891 into master Jun 16, 2024
8 of 9 checks passed
@appleboy appleboy deleted the buntdb branch June 16, 2024 02:05
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.

None yet

1 participant