A few bug fixes and tweaks for the accelerate module

This commit is contained in:
James Cammarata 2015-10-02 00:48:04 -04:00
parent 45c5b4bf4b
commit 79d18981c7

View file

@ -272,6 +272,7 @@ class LocalSocketThread(Thread):
pass
def terminate(self):
super(LocalSocketThread, self).terminate()
self.terminated = True
self.s.shutdown(socket.SHUT_RDWR)
self.s.close()
@ -311,7 +312,6 @@ class ThreadedTCPServer(SocketServer.ThreadingTCPServer):
SocketServer.ThreadingTCPServer.__init__(self, server_address, RequestHandlerClass)
def shutdown(self):
self.local_thread.terminate()
self.running = False
SocketServer.ThreadingTCPServer.shutdown(self)
@ -599,15 +599,14 @@ def daemonize(module, password, port, timeout, minutes, use_ipv6, pid_file):
server.shutdown()
else:
# reschedule the check
vvvv("daemon idle for %d seconds (timeout=%d)" % (total_seconds,minutes*60))
signal.alarm(30)
signal.alarm(1)
except:
pass
finally:
server.last_event_lock.release()
signal.signal(signal.SIGALRM, timer_handler)
signal.alarm(30)
signal.alarm(1)
tries = 5
while tries > 0: