Make cleanup function more robust
This commit is contained in:
parent
264e69fbf8
commit
405a3a8f38
4
pvcd.py
4
pvcd.py
|
@ -148,7 +148,11 @@ def cleanup(signum, frame):
|
|||
# Set stop state in Zookeeper
|
||||
zkhandler.writedata(zk_conn, { '/nodes/{}/daemonstate'.format(myhostname): 'stop' })
|
||||
# Close the Zookeeper connection
|
||||
try:
|
||||
zk_conn.stop()
|
||||
zk_conn.close()
|
||||
except:
|
||||
pass
|
||||
# Stop keepalive thread
|
||||
stopKeepaliveTimer(update_timer)
|
||||
# Exit
|
||||
|
|
Loading…
Reference in New Issue