From 0344fe59c972d206dae7688205298a724db532c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Forr=C3=B3?= Date: Wed, 22 Aug 2018 15:15:43 +0200 Subject: [PATCH] Protect access to scheduler queue with mutex --- rerunbot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rerunbot.py b/rerunbot.py index c41253e..ea379cb 100644 --- a/rerunbot.py +++ b/rerunbot.py @@ -116,7 +116,8 @@ class ReplayBot(irc.bot.SingleServerIRCBot): if int(tags['user-id']) != self.control_user: send_response('Sorry @{0}, you are not allowed to do this'.format(tags['display-name'])) return - self.reactor.scheduler.queue.clear() + with self.reactor.mutex: + self.reactor.scheduler.queue.clear() def _post_message(self, user, msg): self.connection.privmsg(self.output_channel, '[{0}]: {1}'.format(user, msg))