Catch error in case of non successfull API call for new ot-names#448
Conversation
This allows to keep the task running even if the call fail.
|
I added a |
SebastiaanZ
left a comment
There was a problem hiding this comment.
This looks promising, although it won't work in the current form. See my review comment.
From a more meta-perspective, one consequence this approach will have is that if we fail to update the off-topic names due to some temporary outage, they won't be updated until we hit the next UTC midnight. This is not that bad, but we could also think of rescheduling the name change, say, half an hour later if it fails instead of waiting a whole day to try again.
That said, the current changes will already prevent the task from failing completely (minus the thing in the review comment).
`bot.api.ResponseCodeError` is now imported
If an exception occurred
|
Import error fixed and waiting time reduced to half an hour if an exception occurred. |
SebastiaanZ
left a comment
There was a problem hiding this comment.
Hey @Akarys42,
Your general fix is very solid, thanks.
The retry approach works well as well, but we had a conversation about the OffTopicNames cog in the core-dev team and decided that we currently don't want to use retry logic for the off-topic names. I know I was the one who suggested it in the first place, but could you remove it from your PR?
The main reason is that we're thinking of an alternative approach for the entire cog, now that we've got access to features like the new discord.py Tasks. We also want to look into adding more admin control to the off-topic name cog and another way of handling failing connections to the API.
Overall, the core fix is very solid, though, so we do really want to merge that.
After a short discussion in the core-dev team, we decided to not use retry logic for a failed API call for new off-topic-names. We may introduce something similar in the future, but we're not sure on the direction we want to take yet.
This allows to keep the task running even if the call fail.
This PR closes #442