Every block a unique list of accounts that are being trailed are fetched from the server. They are filtered in case the user has not entered the name correctly.
I recommend a validation check before adding trail-ed accounts to the database. A simple get_account call on that step may check the validity of the username..
def is_already_voted(self, voter, author, permlink):
...
You're hiding the exception here with a broad Exception catch. (Good read about this subject)
Edit: You already mentioned that yourself in the post, just saw it, now.
I would at least log it somewhere. :)
And a humble implementation suggestion with list comprehensions:
def is_already_voted(voter, author, permlink):
try:
identifier = f"@{author}/{permlink}"
post = Post(identifier, self.steem)
return voter in [v["voter"] for v in p["active_votes"]]
except Exception as error:
logger.error(error)
return False
the mysql and client access details are now defined outside of the constructer.
Since you have mySQL credentials, steemconnect credentials, etc. I would like to see a config file stores these kind of things.
Also, on errors while voting, a retry mechanism may workaround some issues. (Ex: Retry to vote 3 times if any error happens with a 3 seconds sleep cycle.)
This will block the main process so it will require threading, though.
Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.
To view those questions and the relevant answers related to your post, click here.
Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]
Thanks for the great feedback, I will look into incorporating it into the next update.
Hey @emrebeyler
Here's a tip for your valuable feedback! @Utopian-io loves and incentivises informative comments.
Contributing on Utopian
Learn how to contribute on our website.
Want to chat? Join us on Discord https://discord.gg/h52nFrV.
Vote for Utopian Witness!