cron.go 412 B

123456789101112131415161718192021
  1. package service
  2. import (
  3. "context"
  4. "time"
  5. "go-common/app/job/openplatform/article/dao"
  6. "go-common/library/log"
  7. )
  8. func (s *Service) updateSortproc() {
  9. for {
  10. if err := s.UpdateSort(context.TODO()); err != nil {
  11. log.Error("s.UpdateSort error(%+v)", err)
  12. dao.PromError("service:刷新分区投稿")
  13. } else {
  14. dao.PromInfo("service:刷新分区投稿")
  15. }
  16. time.Sleep(s.updateSortInterval)
  17. }
  18. }