edb_update_log.go 656 B

1234567891011121314151617181920212223
  1. package index_data
  2. import (
  3. "eta_gn/eta_bridge/global"
  4. "eta_gn/eta_bridge/models/index"
  5. "eta_gn/eta_bridge/utils"
  6. "time"
  7. )
  8. // DeleteBeforeTenDayLog
  9. // @Description: 定时删除10天前的指标更新日志
  10. // @author: Roc
  11. // @datetime 2024-03-07 20:01:04
  12. func DeleteBeforeTenDayLog() {
  13. item := index.EdbUpdateLog{}
  14. beforeDay := time.Now().AddDate(0, 0, -global.CONFIG.Mysql.Binlog.LogSaveDay).Format(utils.FormatDate)
  15. //beforeDay := time.Now().AddDate(0, 0, -6).Format(utils.FormatDate)
  16. err := item.DeleteBeforeTenDayLog(beforeDay)
  17. if err != nil {
  18. global.FILE_LOG.Error("定时删除10天前的指标更新日志失败:", err)
  19. }
  20. return
  21. }