Skip to content

Commit

Permalink
bug: rm address iteeration fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
robcxyz committed Nov 24, 2021
1 parent 820d2c5 commit 5140595
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions icon_metrics/workers/supply_cron.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,13 @@ def calculate_organization_supply(addresses):


def get_supply(session, iteration: int):
addresses = []

supply = Supply()
supply.total_supply = int(getTotalSupply(), 16)
supply.timestamp = datetime.now().timestamp()

if iteration % 100 == 0:
# Wait 100 iterations to refresh
query = select(Address).where(Address.organization_wallet)
result = session.execute(query)
addresses = result.scalars().all()
query = select(Address).where(Address.organization_wallet)
result = session.execute(query)
addresses = result.scalars().all()

supply.organization_supply = calculate_organization_supply([i.address for i in addresses])

Expand Down

0 comments on commit 5140595

Please sign in to comment.