Scheduled message causes duplicate messages in sharded app
I have a sharded bot that sends reminders, but sometimes the bot sends duplicate messages. I'm not sure how to prevent this. I've tried:
Yet duplicate reminders are being sent. I'm not sure if this is the correct, what's the standard way to do reminders in a sharded bot?
- Storing the messageId in redis for 10 mins after successfully sending a message, then checking if redis has the messageId before sending, if not found, I send the message
- Implemented mutex
Yet duplicate reminders are being sent. I'm not sure if this is the correct, what's the standard way to do reminders in a sharded bot?