stat.go 353 B

1234567891011121314151617181920
  1. package service
  2. import (
  3. "go-common/app/job/main/search/model"
  4. )
  5. // stat get stat
  6. func (s *Service) stat(appid string) (st *model.Stat) {
  7. s.mutex.RLock()
  8. st = s.stats[appid]
  9. s.mutex.RUnlock()
  10. return
  11. }
  12. // updateStat update stat
  13. func (s *Service) updateStat(appid string, st *model.Stat) {
  14. s.mutex.Lock()
  15. s.stats[appid] = st
  16. s.mutex.Unlock()
  17. }