Skip to content

Commit

Permalink
WarpySyncer: Venus integration - remove total sum query from poller
Browse files Browse the repository at this point in the history
  • Loading branch information
asiaziola committed Aug 19, 2024
1 parent 577b0d6 commit 7a0a6ce
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/warpy_sync/poller_deposit.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,25 +98,6 @@ func (self *PollerDeposit) handleNew() (err error) {
}
interactions := make([]InteractionPayload, len(AssetsSums))

var TotalSum []struct {
Sum float64
}

err = self.db.WithContext(ctx).
Raw(`SELECT SUM(assets)
FROM warpy_syncer_assets
WHERE timestamp < ? AND chain = ? AND protocol = ?;
`, time.Now().Unix()-self.Config.WarpySyncer.PollerDepositSecondsForSelect, self.Config.WarpySyncer.SyncerChain, self.Config.WarpySyncer.SyncerProtocol).
Scan(&TotalSum).Error

if err != nil {
if err != gorm.ErrRecordNotFound {
self.Log.WithError(err).Error("Failed to get assets total sum")
self.monitor.GetReport().WarpySyncer.Errors.PollerDepositFetchError.Inc()
}
return
}

for i, sum := range AssetsSums {
self.monitor.GetReport().WarpySyncer.State.PollerDepositAssetsFromSelects.Inc()
interactions[i] = InteractionPayload{
Expand Down

0 comments on commit 7a0a6ce

Please sign in to comment.