go-common/app/job/main/search/service/stat.go
2019-04-22 18:49:16 +08:00

21 lines
353 B
Go

package service
import (
"go-common/app/job/main/search/model"
)
// stat get stat
func (s *Service) stat(appid string) (st *model.Stat) {
s.mutex.RLock()
st = s.stats[appid]
s.mutex.RUnlock()
return
}
// updateStat update stat
func (s *Service) updateStat(appid string, st *model.Stat) {
s.mutex.Lock()
s.stats[appid] = st
s.mutex.Unlock()
}