Skip to content

Commit

Permalink
if single asset error more than 10 times per day
Browse files Browse the repository at this point in the history
  • Loading branch information
harsh-98 committed Nov 29, 2024
1 parent 3501a6a commit 3cf329c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/Gearbox-protocol/third-eye
go 1.20

require (
github.com/Gearbox-protocol/sdk-go v0.0.0-20241128021016-b2b80f42b5c8
github.com/Gearbox-protocol/sdk-go v0.0.0-20241129154424-efc7511894e0
github.com/ethereum/go-ethereum v1.13.14
github.com/go-playground/validator/v10 v10.4.1
github.com/google/go-cmp v0.5.9
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ contrib.go.opencensus.io/exporter/ocagent v0.6.0/go.mod h1:zmKjrJcdo0aYcVS7bmEeS
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ=
github.com/Gearbox-protocol/sdk-go v0.0.0-20241128021016-b2b80f42b5c8 h1:5qA7lq25Ua/cUOh99rMOsisriR0d9jxZziSYDf/tbz0=
github.com/Gearbox-protocol/sdk-go v0.0.0-20241128021016-b2b80f42b5c8/go.mod h1:jRBSOG94bpGc5ci8EWIPUVXZdaGEaekMNmhajbmWFVU=
github.com/Gearbox-protocol/sdk-go v0.0.0-20241129154424-efc7511894e0 h1:zJ5cviNSuRnPLYRghQ3R4O/4XoCE2BW1crQIEGc4SHM=
github.com/Gearbox-protocol/sdk-go v0.0.0-20241129154424-efc7511894e0/go.mod h1:jRBSOG94bpGc5ci8EWIPUVXZdaGEaekMNmhajbmWFVU=
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
github.com/OffchainLabs/go-ethereum v1.13.4-0.20240313010929-e5d8587e7227 h1:+/3TrD+q+BP36jGj2Bycdmrc/joKLNbc5ImePQzKRLM=
Expand Down
8 changes: 6 additions & 2 deletions models/aggregated_block_feed/single_asset_feed/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package single_asset_feed

import (
"encoding/hex"
"fmt"
"time"

"github.com/Gearbox-protocol/sdk-go/artifacts/multicall"
"github.com/Gearbox-protocol/sdk-go/artifacts/redstone"
Expand Down Expand Up @@ -75,14 +77,16 @@ func (mdl *SingleAssetFeed) GetCalls(blockNum int64) (calls []multicall.Multical
return calls, true
}

var counter = log.SendMsgIfCountMoreThan(24*time.Hour, 10)

// same as query price feed
// func (*YearnPriceFeed) GetCalls(blockNum int64) (calls []multicall.Multicall2Call, isQueryable bool) {

func (mdl *SingleAssetFeed) ProcessResult(blockNum int64, results []multicall.Multicall2Result, force ...bool) *schemas.PriceFeed {
result := results[len(results)-1]
if !result.Success {
log.Warnf("Can't get latestRounData for YearnModule in AQFWrapper for %s(%s) at %d",
mdl.GetDetailsByKey("pfType"), mdl.GetAddress(), blockNum)
counter(mdl.GetAddress(), fmt.Sprintf("Can't get latestRounData for YearnModule in AQFWrapper for %s(%s) at %d",
mdl.GetDetailsByKey("pfType"), mdl.GetAddress(), blockNum))
return nil
//
}
Expand Down

0 comments on commit 3cf329c

Please sign in to comment.