Conversation
| return false, 0, errors.Wrap(err, "transaction failed") | ||
| } | ||
|
|
||
| _, err = conn.Do("EXPIRE", key, 60*60*24*30) |
There was a problem hiding this comment.
Did you try adding this before the EXEC above? Then it's run in the same transaction, which should be slightly better.
There was a problem hiding this comment.
@arp242 hey martin - good to see hear from you. No i purposely put this out the transaction block to ensure the ttl is only applied in case the transaction is successful. Wouldn't want to ttl the list if something went weird in the multi above. You could argue that the ttl applies in any case, i'll let @ripexz decide
There was a problem hiding this comment.
kk, just wasn't clear if you did it on purpose or if you just didn't notice. I don't really have an opinion other than that, although the transaction should be atomic(?)
Haven't seen you around since I got in Cork btw! Drop me a line at martin@arp242.net and we'll set up a date next week 😚 (I'll be leaving again after that)
sets a ttl on a zlist of ratelimit keys to avoid old keys lying around.