Fixed the looping bug on killed thread
This commit is contained in:
parent
b4fa6de4b8
commit
f77f92213d
|
@ -117,10 +117,11 @@ class Shoutbox(object):
|
|||
logging.info(f"matched {event.__name__}")
|
||||
callback(message)
|
||||
# kill afk clients
|
||||
for c in self.irc_clients.values():
|
||||
for k, c in self.irc_clients.items():
|
||||
if datetime.datetime.now() - c[1] > datetime.timedelta(hours=1):
|
||||
logging.info(f"killing {c[0].nick}")
|
||||
c[0].stop()
|
||||
self.irc_clients.pop(k)
|
||||
except Exception as e:
|
||||
logging.error(f"Faillure in Shoutbox thread {e}")
|
||||
finally:
|
||||
|
|
Loading…
Reference in New Issue