mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-28 05:29:25 +01:00
Irc: reconnect instead of killing when an error is received
This commit is contained in:
parent
f786242730
commit
fdcb58ba2c
7
main.py
7
main.py
@ -7,7 +7,6 @@ import time
|
|||||||
import sys
|
import sys
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
import threading
|
import threading
|
||||||
import _thread
|
|
||||||
|
|
||||||
from log import log
|
from log import log
|
||||||
import conf
|
import conf
|
||||||
@ -133,10 +132,8 @@ class Irc():
|
|||||||
try:
|
try:
|
||||||
hook_args = self.proto.handle_events(self, line)
|
hook_args = self.proto.handle_events(self, line)
|
||||||
except Exception:
|
except Exception:
|
||||||
# We broke! Shutdown immediately.
|
log.exception('(%s) Caught error in handle_events, disconnecting!', self.name)
|
||||||
log.exception('(%s) Caught error in handle_events, exiting!', self.name)
|
return
|
||||||
_thread.interrupt_main()
|
|
||||||
sys.exit(4)
|
|
||||||
# Only call our hooks if there's data to process. Handlers that support
|
# Only call our hooks if there's data to process. Handlers that support
|
||||||
# hooks will return a dict of parsed arguments, which can be passed on
|
# hooks will return a dict of parsed arguments, which can be passed on
|
||||||
# to plugins and the like. For example, the JOIN handler will return
|
# to plugins and the like. For example, the JOIN handler will return
|
||||||
|
Loading…
Reference in New Issue
Block a user