Skip to content

Commit a0a92c9

Browse files
committed
Use only allowed sync adapter for lastadaptersync value
1 parent 5b65a99 commit a0a92c9

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

debts/debt_db.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ func (eng *DebtEngine) AddDebt(debt *core.Debt, forceAdd bool) {
1212
if lastDebt != nil {
1313
if core.ValueDifferSideOf10000(debt.CalHealthFactor, lastDebt.CalHealthFactor) {
1414
eng.addLiquidableAccount(debt.SessionId, debt.BlockNumber)
15-
log.Msgf("Session(%s)'s hf changed %d at (block:%d) -> %d at (block:%d)", debt.SessionId, lastDebt.CalHealthFactor, lastDebt.BlockNumber, debt.CalHealthFactor, debt.BlockNumber)
15+
log.Msgf("Session(%s)'s hf changed %s at (block:%d) -> %s at (block:%d)", debt.SessionId, lastDebt.CalHealthFactor, lastDebt.BlockNumber, debt.CalHealthFactor, debt.BlockNumber)
1616
}
1717
}
1818
if eng.config.ThrottleDebtCal {

debts/engine.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ func (eng *DebtEngine) calculateDebt() {
117117

118118
func (eng *DebtEngine) ifAccountClosed(sessionId string, closedAt int64, status int) {
119119
if status == core.Liquidated {
120-
log.Info(sessionId, closedAt)
121120
account := eng.liquidableBlockTracker[sessionId]
122121
log.Msgf("Session(%s) liquidated at block:%d liquidable since %d ", sessionId, closedAt, account.BlockNum)
123122
} else if status != core.Active {

repository/debt_db.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func (repo *Repository) LoadLastDebtSync() int64 {
2222

2323
func (repo *Repository) LoadLastAdapterSync() int64 {
2424
data := core.DebtSync{}
25-
query := "SELECT min(last_sync) as last_calculated_at FROM sync_adapters"
25+
query := "SELECT min(last_sync) as last_calculated_at FROM sync_adapters where disabled=false"
2626
err := repo.db.Raw(query).Find(&data).Error
2727
if err != nil {
2828
log.Fatal(err)

0 commit comments

Comments
 (0)