Skip to content

Commit

Permalink
Add suggestions fix wrong crontab
Browse files Browse the repository at this point in the history
  • Loading branch information
moisses89 committed Jan 13, 2025
1 parent 759b95b commit e07f147
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/datasources/db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ async def get_abi_by_contract_address(
return None

@classmethod
async def get_contracts_without_abi(cls, session: AsyncSession, max_retries: int):
async def get_contracts_without_abi(
cls, session: AsyncSession, max_retries: int = 0
):
"""
Fetches contracts without an ABI and fewer retries than max_retries, streaming results in batches to reduce memory usage for large datasets.
More information about streaming results can be found here: https://docs.sqlalchemy.org/en/20/core/connections.html#streaming-with-a-dynamically-growing-buffer-using-stream-results
Expand Down
2 changes: 1 addition & 1 deletion app/workers/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ async def get_contract_metadata_task(
logging.debug(f"Skipping contract with address {address} and chain {chain_id}")


@dramatiq.actor(periodic=cron("* * * * *")) # Every midnight
@dramatiq.actor(periodic=cron("0 0 * * *")) # Every midnight
@database_session
async def get_missing_contract_metadata_task(session: AsyncSession) -> None:
async for contract in Contract.get_contracts_without_abi(
Expand Down

0 comments on commit e07f147

Please sign in to comment.