save_log.go 594 B

12345678910111213141516171819202122232425262728
  1. package services
  2. import (
  3. "context"
  4. "eta_gn/eta_task/models/data_manage"
  5. "eta_gn/eta_task/services/alarm_msg"
  6. "eta_gn/eta_task/utils"
  7. "time"
  8. )
  9. func DeleteLog(cont context.Context) (err error) {
  10. date := time.Now().AddDate(0, -1, 0).Format(utils.FormatDate)
  11. go func() {
  12. err = data_manage.DeletePPTLogByDate(date)
  13. if err != nil {
  14. alarm_msg.SendAlarmMsg("DeletePPTLogByDate ErrMsg:"+err.Error(), 3)
  15. }
  16. }()
  17. go func() {
  18. err = data_manage.DeleteReportLogByDate(date)
  19. if err != nil {
  20. alarm_msg.SendAlarmMsg("DeleteReportLogByDate ErrMsg:"+err.Error(), 3)
  21. }
  22. }()
  23. return
  24. }