Avoid 100% CPU loop during heavy usage

This commit is contained in:
Jordyn 2026-03-14 04:43:40 -05:00
commit ca21c914ef

View file

@ -120,7 +120,7 @@ class Server():
# Can't use die because we have no connection... just quit I suppose # Can't use die because we have no connection... just quit I suppose
self._going_down.set() self._going_down.set()
raise SystemExit(1) raise SystemExit(1)
print("[SENDTHREAD] Quitting due to thread condition!") print("[SENDTHREAD] Quitting due to thread condition!")
# This is the function used to process messages from the server # This is the function used to process messages from the server
@ -338,9 +338,9 @@ class Server():
self.privmsg(target_channel, line) self.privmsg(target_channel, line)
# Wait is required to fetch exit code # Break if our child exits for any reason
proc.wait() if proc.poll():
self.privmsg(target_channel, f"CMD {cmd} exited with returncode {proc.returncode}") break
if __name__ == "__main__": if __name__ == "__main__":
serv = Server(**config.user, **config.bot) serv = Server(**config.user, **config.bot)