mirror of
https://github.com/a-bad-dev/irc2bash.git
synced 2026-06-09 00:51:32 +00:00
Avoid 100% CPU loop during heavy usage
This commit is contained in:
parent
2fbc2cf051
commit
ca21c914ef
1 changed files with 4 additions and 4 deletions
8
main.py
8
main.py
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue