diff --git a/proxywatchd.py b/proxywatchd.py index aad9231..b693603 100644 --- a/proxywatchd.py +++ b/proxywatchd.py @@ -46,19 +46,19 @@ class WorkerJob(): sock = rocksock.Rocksock(host=srv, port=6697, ssl=True, proxies=proxies, timeout=config.timeout) sock.connect() sock.send('%s\n' % random.choice(['NICK', 'USER', 'JOIN', 'MODE', 'PART', 'INVITE', 'KNOCK', 'WHOIS', 'WHO', 'NOTICE', 'PRIVMSG', 'PING', 'QUIT'])) - return sock, proto, duration, torhost, srv + return sock, proto, duration, torhost, srv, 0 except KeyboardInterrupt as e: raise(e) except: sock.disconnect() - return None, None, None, None, None + return None, None, None, None, None, 1 def run(self): self.nextcheck = (time.time() + 1800 + ((1+int(self.failcount)) * 3600)) - sock, proto, duration, tor, srv = self.connect_socket() + sock, proto, duration, tor, srv, failinc = self.connect_socket() if not sock: - self.failcount += 1 + self.failcount += failinc return try: recv = sock.recv(6)