Finish the System Cleanup feature.

This commit is contained in:
zicla
2019-04-04 03:14:47 +08:00
parent 7697891807
commit 5936f917b3
15 changed files with 158 additions and 15 deletions

View File

@ -197,3 +197,12 @@ func (this *ImageCacheDao) SizeBetweenTime(startTime time.Time, endTime time.Tim
row.Scan(&size)
return size
}
//执行清理操作
func (this *ImageCacheDao) Cleanup() {
this.logger.Info("[ImageCacheDao]执行清理清除数据库中所有ImageCache记录。")
db := CONTEXT.DB.Where("uuid is not null").Delete(ImageCache{})
this.PanicError(db.Error)
}