-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add get missing metadata contracts task #58
base: main
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 12694200882Details
💛 - Coveralls |
@@ -281,15 +281,20 @@ async def get_abi_by_contract_address( | |||
return None | |||
|
|||
@classmethod | |||
async def get_contracts_without_abi(cls, session: AsyncSession): | |||
async def get_contracts_without_abi(cls, session: AsyncSession, max_retries: int): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO max_retries
parameter should be optional and takes 0 as default value. WDYT?
) -> None: | ||
contract_metadata_service = get_contract_metadata_service() | ||
# Just try the first time, following retries should be scheduled | ||
if await contract_metadata_service.should_attempt_download( | ||
if skip_attemp_download or await contract_metadata_service.should_attempt_download( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpicky: contract_metadata_service.should_attempt_download
conditional can be in a separate variable. It would be more understandable in the future. The comment only affects the second part of the condition
@@ -61,3 +66,16 @@ async def get_contract_metadata_task( | |||
) | |||
else: | |||
logging.debug(f"Skipping contract with address {address} and chain {chain_id}") | |||
|
|||
|
|||
@dramatiq.actor(periodic=cron("* * * * *")) # Every midnight |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be every midnight not every day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* * * * *
means every minute, right?
Closes #52