mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-01 01:09:22 +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
|
||||
from collections import defaultdict
|
||||
import threading
|
||||
import _thread
|
||||
|
||||
from log import log
|
||||
import conf
|
||||
@ -133,10 +132,8 @@ class Irc():
|
||||
try:
|
||||
hook_args = self.proto.handle_events(self, line)
|
||||
except Exception:
|
||||
# We broke! Shutdown immediately.
|
||||
log.exception('(%s) Caught error in handle_events, exiting!', self.name)
|
||||
_thread.interrupt_main()
|
||||
sys.exit(4)
|
||||
log.exception('(%s) Caught error in handle_events, disconnecting!', self.name)
|
||||
return
|
||||
# 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
|
||||
# to plugins and the like. For example, the JOIN handler will return
|
||||
|
Loading…
Reference in New Issue
Block a user