Skip to content

Commit

Permalink
feat: update health
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-bisonai committed Jan 16, 2025
1 parent 1a034d5 commit 63d7390
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions node/pkg/checker/dal/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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]++
Expand Down Expand Up @@ -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")
Expand Down
5 changes: 5 additions & 0 deletions node/pkg/checker/delisted.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package checker

var DelistedSymbols = []string{
"JOY-USDT",
}
6 changes: 6 additions & 0 deletions node/pkg/checker/event/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 63d7390

Please sign in to comment.