mirror of https://github.com/statping/statping
Merge pull request #208 from Naramsim/master
Fix failures' heatmap when connected to postgrespull/219/head
commit
17c633f8bf
|
@ -129,7 +129,7 @@ func CountFailures() uint64 {
|
||||||
func (s *Service) TotalFailuresOnDate(ago time.Time) (uint64, error) {
|
func (s *Service) TotalFailuresOnDate(ago time.Time) (uint64, error) {
|
||||||
var count uint64
|
var count uint64
|
||||||
date := ago.UTC().Format("2006-01-02 00:00:00")
|
date := ago.UTC().Format("2006-01-02 00:00:00")
|
||||||
dateend := ago.UTC().Format("2006-01-02 23:59:59")
|
dateend := ago.UTC().Format("2006-01-02") + " 23:59:59"
|
||||||
rows := failuresDB().Where("service = ? AND created_at BETWEEN ? AND ?", s.Id, date, dateend).Not("method = 'checkin'")
|
rows := failuresDB().Where("service = ? AND created_at BETWEEN ? AND ?", s.Id, date, dateend).Not("method = 'checkin'")
|
||||||
err := rows.Count(&count)
|
err := rows.Count(&count)
|
||||||
return count, err.Error
|
return count, err.Error
|
||||||
|
|
Loading…
Reference in New Issue