code_expired_task.go 728 B

12345678910111213141516171819202122232425262728293031
  1. package sms
  2. import (
  3. logger "eta/eta_mini_ht_api/common/component/log"
  4. "eta/eta_mini_ht_api/domian/sms"
  5. "eta/eta_mini_ht_api/task/base"
  6. )
  7. var (
  8. taskName base.TaskType = "ExpiredCodeTask"
  9. cron = "0/10 * * * * *"
  10. )
  11. // Execute Task ETA取研报的数据
  12. func (st *SMSTask) Execute(taskDetail *base.TaskDetail) error {
  13. //logger.Info(contants.TaskFormat, "处理过期短信开始")
  14. err := sms.VerifiedCodeTask()
  15. if err != nil {
  16. logger.Error("自动更新短信状态失败:%v", err)
  17. }
  18. //logger.Info(contants.TaskFormat, "处理过期短信结束")
  19. return err
  20. }
  21. type SMSTask struct {
  22. }
  23. func init() {
  24. smsTask := base.NewTask(taskName, cron, new(SMSTask), base.PROD)
  25. base.RegisterTask(&smsTask)
  26. }