go-common/app/admin/main/cache/service/opscache.go

25 lines
356 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package service
import (
"context"
"time"
)
func (s *Service) loadOpsCache() {
mcs, err := s.dao.OpsMemcaches(context.Background())
if err == nil {
s.opsMcs = mcs
}
rds, err := s.dao.OpsRediss(context.Background())
if err == nil {
s.opsRds = rds
}
}
func (s *Service) loadOpsproc() {
for {
s.loadOpsCache()
time.Sleep(time.Minute)
}
}