tweaked reconnection logic.
This commit is contained in:
parent
afc8a72f05
commit
a09bce0024
1 changed files with 2 additions and 1 deletions
|
@ -26,6 +26,7 @@ class Bot(object):
|
||||||
self.servers[new_server.fileno()] = new_server
|
self.servers[new_server.fileno()] = new_server
|
||||||
if connect and new_server.get_setting("connect", True):
|
if connect and new_server.get_setting("connect", True):
|
||||||
self.connect(new_server)
|
self.connect(new_server)
|
||||||
|
return new_server
|
||||||
def connect(self, server):
|
def connect(self, server):
|
||||||
try:
|
try:
|
||||||
server.connect()
|
server.connect()
|
||||||
|
@ -94,7 +95,7 @@ class Bot(object):
|
||||||
|
|
||||||
def reconnect(self, event):
|
def reconnect(self, event):
|
||||||
server_details = self.database.get_server(event["server_id"])
|
server_details = self.database.get_server(event["server_id"])
|
||||||
server = IRCServer.Server(*server_details, self)
|
server = self.add_server(*server_details, False)
|
||||||
if self.connect(server):
|
if self.connect(server):
|
||||||
self.servers[server.fileno()] = server
|
self.servers[server.fileno()] = server
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue