Skip to content

Commit

Permalink
fix: lastSync of the querPricefeed might not be same as lastSync of A…
Browse files Browse the repository at this point in the history
…ddressProvider
  • Loading branch information
harsh-98 committed Feb 13, 2024
1 parent 9e155ec commit 76b92df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion debts/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,11 @@ func (eng *DebtEngine) notifiedIfLiquidable(sessionId string, notified bool) {
liquidableAccount.Updated = true
}

// QueryPriceFeed is updated only till the lastFetchedBlock, not the syncTill that is provided to the aqfwrapper's aftersynchook from engine/index.go in the syncmodel. So, ignore that for updating the debts.
func (eng *DebtEngine) AreActiveAdapterSynchronized() bool {
data := schemas.DebtSync{}
query := `SELECT count(distinct last_sync) as last_calculated_at FROM sync_adapters
WHERE disabled=false AND type NOT IN ('RebaseToken','Treasury','LMRewardsv2','LMRewardsv3','GearToken')`
WHERE disabled=false AND type NOT IN ('QueryPriceFeed','RebaseToken','Treasury','LMRewardsv2','LMRewardsv3','GearToken')`
err := eng.db.Raw(query).Find(&data).Error
if err != nil {
log.Fatal(err)
Expand Down

0 comments on commit 76b92df

Please sign in to comment.