-
Notifications
You must be signed in to change notification settings - Fork 45
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
fix fre/dispenser monitor #919
Conversation
@@ -105,7 +105,7 @@ def read(self, resource_id): | |||
:param resource_id: id of the object to be read. | |||
:return: object value from elasticsearch. | |||
""" | |||
logger.debug("elasticsearch::read::{}".format(resource_id)) | |||
# logger.debug("elasticsearch::read::{}".format(resource_id)) |
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.
Should we add a log here as well?
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.
no, this will flood the console with reads for non-existing assets because of non-ocean NFT transfers
Code Climate has analyzed commit b00b138 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 73.6% (50% is the threshold). This pull request will bring the total coverage in the repository to 89.7% (-0.8% change). View more on Code Climate. |
@@ -172,7 +174,12 @@ def process_current_blocks(self): | |||
self.retry_mechanism.process_queue() | |||
|
|||
last_block = self.get_last_processed_block() |
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.
instead of the while True loop couldn't we do a isinstance(last_processed_block, int)? a while True nested in 2 try / except can have unexpected behaviors
current_block = self._web3.eth.block_number | ||
current_block = None | ||
try: | ||
current_block = self._web3.eth.block_number |
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.
depending on the congestion of the network this can consistenly fail, as block_number usually returns a promise that ultimately resolves to a string. Coroutines in python could solve this. What do you think?
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.
made a couple of comments that perhaps we can discuss when thinking about reviewing (and separating responsibilities) in this
Critical issues resolved:
Major changes were done in handle_price_change , in events_monitor.py
Also, improved logging a little bit