From 07ea702d584eb9ca15bd6d54f7f41bda98ba62a3 Mon Sep 17 00:00:00 2001 From: lionel Date: Wed, 31 Aug 2016 17:00:34 +0200 Subject: [PATCH] Fix : little changes before first try --- romulus | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/romulus b/romulus index 4dc2751..2172eb2 100755 --- a/romulus +++ b/romulus @@ -49,7 +49,7 @@ class App(): s.bind((MY_TCP_IP, MY_TCP_PORT)) s.listen(1) while True: - time.sleep(1) + time.sleep(3) conn, addr = s.accept() if not conn: break data = conn.recv(MY_BUFFER_SIZE) @@ -85,10 +85,10 @@ class App(): ''' Launching the heartbeat function ''' - p = Process(target=heartbeat, args=(False,)) - p.daemon = True - p.start() - heartbeat_pid = p.pid + hbp = Process(target=heartbeat, args=(False,)) + hbp.daemon = True + hbp.start() + heartbeat_pid = hbp.pid logger.info("heartbeat loop launched (pid " + str(heartbeat_pid) + ")") ''' @@ -99,7 +99,8 @@ class App(): while True: time.sleep(30) except: - logger.error("While loop interrupted : aborting") + logger.error("Main infinit while loop interrupted : aborting") + hbp.stop() # Faut arrêter les Process ... # Invocation of the daemon part -- 2.39.2