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:
  • 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
I've observed duplicate reminders are being sent when too many messages are sent
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?
Was this page helpful?