revert bump to markdownify version, ensure redis cache ttl is set correctly#2156
Conversation
The new versions introduce conversions which causes the doc command embed to be formatted improperly
if the expire "cache" is not reset, the class assumes an expire is set, even though no expire was set for the key
The task is no longer created in the cog
a5561be to
4cdaaf4
Compare
wookie184
left a comment
There was a problem hiding this comment.
This seems alright but i'm not 100% sure on the changes to the set function. I may just be misunderstanding though.
If set was called after a bot restart with an hour until a key expired, the expiry would not be changed but the _set_expires value would be set to a week. If set was called a day later, after the key had expired, the key would be set but no expiry would be set. I'm not sure if this would happen with the current workings of doc but if it didn't i'm not sure how the changes would help.
Would a more robust change be to replace needs_expire = not await connection.exists(redis_key) with checking the ttl is greater than 0 https://redis.io/commands/ttl/ (so we catch keys that didn't exist before and also keys with no expiry set). Then we can put that expiry in _set_expires, which seems safer than assuming it's just a week from now. If it wasn't set we can set the expiry and also set it in _set_expires.
|
Thanks, I forgot to take into account the ongoing expires in redis, should be fine now I believe |
wookie184
left a comment
There was a problem hiding this comment.
One thing, other than that all looks good.
wookie184
left a comment
There was a problem hiding this comment.
All seems good to me. Thanks
|
For the record, I'm highly opposed to the philosophy of not updating our deps because we can, however that's not a reason to block the PR for now since it'll fix the bug. We can work on getting it working in another PR. I suspect no one will pick that up though, so I'll try to get it to it once I have some free time. |
# Conflicts: # poetry.lock
The new versions bumped in bd13ed6 introduce conversions which cause the doc embeds to be formatted improperly, e.g.
I've also removed an invalid task cancel in 4cdaaf4, and ensured that an expire is set after a cache clear in df99fa8