6 "github.com/jinzhu/gorm"
7 log "github.com/sirupsen/logrus"
9 "github.com/vapor/toolbar/precog/config"
13 const checkFreqSeconds = 60
20 func NewMonitor(cfg *config.Config, db *gorm.DB) *monitor {
27 func (s *monitor) Run() {
28 if err := s.updateNodesHostPort(); err != nil {
32 ticker := time.NewTicker(checkFreqSeconds * time.Second)
33 for ; true; <-ticker.C {
37 func (s *monitor) updateNodesHostPort() error {