bnj.go 489 B

12345678910111213141516171819202122232425262728
  1. package service
  2. import (
  3. "context"
  4. "time"
  5. arcmdl "go-common/app/interface/main/app-player/model/archive"
  6. "go-common/library/log"
  7. )
  8. func (s *Service) loadBnjArc() {
  9. var (
  10. arcs map[int64]*arcmdl.Info
  11. err error
  12. )
  13. if arcs, err = s.arcDao.Views(context.Background(), s.c.Bnj.Aids); err != nil {
  14. log.Error("s.arcDao.Views error(%+v)", err)
  15. return
  16. }
  17. s.bnjArcs = arcs
  18. }
  19. func (s *Service) bnjTickproc() {
  20. for {
  21. time.Sleep(time.Duration(s.c.Bnj.Tick))
  22. s.loadBnjArc()
  23. }
  24. }