]> gitweb.maison.local Git - rome.git/commitdiff
Fix : little changes before first try
authorlionel <lionel@isis.maison.local>
Wed, 31 Aug 2016 15:00:34 +0000 (17:00 +0200)
committerlionel <lionel@isis.maison.local>
Wed, 31 Aug 2016 15:00:34 +0000 (17:00 +0200)
romulus

diff --git a/romulus b/romulus
index 4dc2751e255000b9eb988f0cd8edd2f7b1510102..2172eb22133ddd202c87b8b17fc1e77297ae4667 100755 (executable)
--- 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