|
@@ -9,10 +9,11 @@ import (
|
|
|
|
|
|
|
|
|
func BagCacheClean() {
|
|
|
- log.GlobalLogger.Info("启动清理缓存的 goroutine 维护 data 目录内的 bag 包数量:", cfg.CloudConfig.BagNumber)
|
|
|
+ log.GlobalLogger.Info("启动清理缓存的 goroutine 维护目录【", cfg.CloudConfig.BagDataDir, "】的 bag 包数量:", cfg.CloudConfig.BagNumber)
|
|
|
for {
|
|
|
|
|
|
if signal := <-ChannelKillDiskClean; signal == 1 {
|
|
|
+ AddKillTimes("2")
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -22,6 +23,7 @@ func BagCacheClean() {
|
|
|
bags := util.ListAbsolutePathWithSuffixAndSort(cfg.CloudConfig.BagDataDir, ".bag")
|
|
|
|
|
|
if len(bags) > cfg.CloudConfig.BagNumber {
|
|
|
+ log.GlobalLogger.Infof("目录【%v】内文件数量超过【%v】,删除第一个文件")
|
|
|
util.DeleteFile(bags[0])
|
|
|
}
|
|
|
}
|