csgo-league/csgo-league-bot

Race condition when updating last queue message

Closed this issue · 0 comments

update_last_msg() has a race condition when two users simultaneously issue commands that call this function. They both try to delete the last message (where one of them fails to do so) and then both send the new message, and the one that's delivered first gets sent after the second one has already deleted (or tried to) delete the original. Both messages send and neither get deleted, leaving two queue embed messages in the chat.