From 63d7390abfaa9de1776278e54b4728ac913a17c9 Mon Sep 17 00:00:00 2001 From: nick Date: Thu, 16 Jan 2025 12:39:09 +0900 Subject: [PATCH] feat: update health --- node/pkg/checker/dal/app.go | 10 ++++++++++ node/pkg/checker/delisted.go | 5 +++++ node/pkg/checker/event/app.go | 6 ++++++ 3 files changed, 21 insertions(+) create mode 100644 node/pkg/checker/delisted.go diff --git a/node/pkg/checker/dal/app.go b/node/pkg/checker/dal/app.go index 8bb7d2616..b46ced81b 100644 --- a/node/pkg/checker/dal/app.go +++ b/node/pkg/checker/dal/app.go @@ -6,11 +6,13 @@ import ( "errors" "fmt" "os" + "slices" "strconv" "strings" "time" "bisonai.com/miko/node/pkg/alert" + "bisonai.com/miko/node/pkg/checker" "bisonai.com/miko/node/pkg/db" "bisonai.com/miko/node/pkg/secrets" "bisonai.com/miko/node/pkg/utils/request" @@ -32,6 +34,10 @@ func (u *UpdateTimes) CheckLastUpdateOffsets(alarmCount map[string]int) []string websocketNotPushedCount := 0 var messages []string for symbol, updateTime := range u.lastUpdates { + if slices.Contains(checker.DelistedSymbols, symbol) { + continue + } + elapsedTime := time.Since(updateTime) if elapsedTime > WsPushThreshold { alarmCount[symbol]++ @@ -164,6 +170,10 @@ func checkDal(endpoint string, key string, alarmCount map[string]int, networkDel totalDelayed := 0 for _, data := range resp { + if slices.Contains(checker.DelistedSymbols, data.Symbol) { + continue + } + rawTimestamp, err := strconv.ParseInt(data.AggregateTime, 10, 64) if err != nil { log.Error().Str("Player", "DalChecker").Err(err).Msg("failed to convert timestamp string to int64") diff --git a/node/pkg/checker/delisted.go b/node/pkg/checker/delisted.go new file mode 100644 index 000000000..c5568925c --- /dev/null +++ b/node/pkg/checker/delisted.go @@ -0,0 +1,5 @@ +package checker + +var DelistedSymbols = []string{ + "JOY-USDT", +} diff --git a/node/pkg/checker/event/app.go b/node/pkg/checker/event/app.go index 9a162d0c6..b89d19c76 100644 --- a/node/pkg/checker/event/app.go +++ b/node/pkg/checker/event/app.go @@ -4,10 +4,12 @@ import ( "context" "fmt" "os" + "slices" "strings" "time" "bisonai.com/miko/node/pkg/alert" + "bisonai.com/miko/node/pkg/checker" "bisonai.com/miko/node/pkg/db" "bisonai.com/miko/node/pkg/utils/request" "github.com/rs/zerolog/log" @@ -53,6 +55,10 @@ func setUp(ctx context.Context) (*CheckList, error) { FeedsToCheck := []FeedToCheck{} for _, config := range configs { + if slices.Contains(checker.DelistedSymbols, config.Name) { + continue + } + subgraphInfo, ok := subgraphInfoMap[config.Name] if !ok { continue