@@ -113,7 +113,7 @@ func (mdl *AQFWrapper) QueryData(blockNum int64) []*schemas.PriceFeed {
113113 for i := 0 ; i < entry .nocalls ; i ++ {
114114 results = append (results , iterator .Next ())
115115 }
116- pf := processRoundDataWithAdapterTokens (blockNum , entry .adapter , results )
116+ pf := processRoundDataWithAdapterTokens (blockNum , entry .adapter , results , getForceForAdapter ( mdl . Repo , entry . adapter ) )
117117 queryFeedPrices = append (queryFeedPrices , pf ... )
118118 }
119119 //
@@ -145,15 +145,27 @@ func (mdl *AQFWrapper) getRoundDataCalls(blockNum int64) (calls []multicall.Mult
145145 return
146146}
147147
148- func processRoundDataWithAdapterTokens (blockNum int64 , adapter ds.QueryPriceFeedI , entries []multicall.Multicall2Result ) []* schemas.PriceFeed {
148+ func processRoundDataWithAdapterTokens (blockNum int64 , adapter ds.QueryPriceFeedI , entries []multicall.Multicall2Result , force bool ) []* schemas.PriceFeed {
149149
150150 // } else if utils.Contains([]string{"0xCbeCfA4017965939805Da5a2150E3DB1BeDD0364", "0x814E6564e8cda436c1ab25041C10bfdb21dEC519"},
151151
152- priceData := adapter .ProcessResult (blockNum , entries , "" )
152+ priceData := adapter .ProcessResult (blockNum , entries , "" , force )
153153 if priceData == nil {
154154 return nil
155155 }
156156 priceData .Feed = adapter .GetAddress ()
157157 priceData .BlockNumber = blockNum
158158 return []* schemas.PriceFeed {priceData }
159159}
160+
161+ func getForceForAdapter (repo ds.RepositoryI , adapter ds.QueryPriceFeedI ) bool {
162+ var force bool
163+ if price := repo .GetPrevPriceFeed (adapter .GetAddress ()); price != nil {
164+
165+ force = time .Since (time .Unix (int64 (repo .SetAndGetBlock (price .BlockNumber ).Timestamp ), 0 )) > time .Hour
166+ if force {
167+ log .Info (adapter .GetAddress (), "last price at " , price .BlockNumber )
168+ }
169+ }
170+ return force
171+ }
0 commit comments