Feature: flush fakeip pool

This commit is contained in:
yaling888
2022-03-23 01:05:43 +08:00
parent f4312cfa5a
commit ef915c94dc
12 changed files with 137 additions and 2 deletions

View File

@ -132,6 +132,17 @@ func (c *CacheFile) GetFakeip(key []byte) []byte {
return bucket.Get(key)
}
func (c *CacheFile) FlushFakeIP() error {
err := c.DB.Batch(func(t *bbolt.Tx) error {
bucket := t.Bucket(bucketFakeip)
if bucket == nil {
return nil
}
return t.DeleteBucket(bucketFakeip)
})
return err
}
func (c *CacheFile) Close() error {
return c.DB.Close()
}