mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
A few bug fixes and tweaks for the accelerate module
This commit is contained in:
committed by
Matt Clay
parent
45907f2ff3
commit
395253c581
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user