mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2026-01-01 11:06:52 +08:00
使用KV存储实现指标统计
This commit is contained in:
@@ -52,6 +52,15 @@ func (this *DB) Store() *Store {
|
||||
return this.store
|
||||
}
|
||||
|
||||
// Truncate the database
|
||||
func (this *DB) Truncate() error {
|
||||
this.mu.Lock()
|
||||
defer this.mu.Unlock()
|
||||
|
||||
var start = []byte(this.Namespace())
|
||||
return this.store.rawDB.DeleteRange(start, append(start, 0xFF), DefaultWriteOptions)
|
||||
}
|
||||
|
||||
func (this *DB) Close() error {
|
||||
this.mu.Lock()
|
||||
defer this.mu.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user