Stats errors in Sentry
All checks were successful
Unittests / unittests (push) Successful in 9s
Unittests / deploy-dev (push) Successful in 52s

This commit is contained in:
Adam Štrauch 2024-01-26 21:43:45 +01:00
parent 7a170e56d6
commit a3d0ee92ce
Signed by: cx
GPG Key ID: 7262DAFE292BCE20

View File

@ -3,6 +3,7 @@ package glue
import ( import (
"log" "log"
"github.com/getsentry/sentry-go"
"github.com/jinzhu/gorm" "github.com/jinzhu/gorm"
"github.com/rosti-cz/node-api/apps" "github.com/rosti-cz/node-api/apps"
docker "github.com/rosti-cz/node-api/containers" docker "github.com/rosti-cz/node-api/containers"
@ -102,6 +103,7 @@ func (s *StatsProcessor) GatherStats() error {
for _, app := range appList { for _, app := range appList {
err := s.UpdateUsage(app.Name) err := s.UpdateUsage(app.Name)
if err != nil { if err != nil {
sentry.CaptureException(err)
log.Println("STATS ERROR:", err.Error()) log.Println("STATS ERROR:", err.Error())
} }
} }
@ -120,6 +122,7 @@ func (s *StatsProcessor) GatherStates() error {
for _, app := range appList { for _, app := range appList {
err := s.UpdateState(app.Name) err := s.UpdateState(app.Name)
if err != nil { if err != nil {
sentry.CaptureException(err)
log.Println("STATE ERROR:", err.Error()) log.Println("STATE ERROR:", err.Error())
} }
} }