statping/types/services/checkins.go

19 lines
382 B
Go
Raw Normal View History

2020-03-04 10:29:00 +00:00
package services
import (
2020-03-09 18:17:55 +00:00
"github.com/statping/statping/types/checkins"
2020-03-04 10:29:00 +00:00
)
// CheckinProcess runs the checkin routine for each checkin attached to service
func CheckinProcess(s *Service) {
for _, c := range s.Checkins() {
c.Start()
}
}
func (s *Service) Checkins() []*checkins.Checkin {
var chks []*checkins.Checkin
2020-03-10 05:24:35 +00:00
db.Where("service = ?", s.Id).Find(&chks)
2020-03-04 10:29:00 +00:00
return chks
}