svghmi/svghmi_server.py
changeset 4003 65aae40f81dd
parent 3864 3e434edfbfdf
child 4004 19f8192b7d68
--- a/svghmi/svghmi_server.py	Thu Aug 01 12:11:11 2024 +0200
+++ b/svghmi/svghmi_server.py	Tue Aug 06 15:25:57 2024 +0200
@@ -310,9 +310,9 @@
     def waitpid_timeout_loop(proc = proc, timeout = timeout):
         try:
             while proc.poll() is None:
-                time.sleep(1)
-                timeout = timeout - 1
-                if not timeout:
+                time.sleep(.1)
+                timeout = timeout - .1
+                if timeout <= 0:
                     GetPLCObjectSingleton().LogMessage(
                         LogLevelsDict["WARNING"], 
                         "Timeout waiting for {} PID: {}".format(helpstr, str(proc.pid)))
@@ -320,5 +320,5 @@
         except OSError:
             # workaround exception "OSError: [Errno 10] No child processes"
             pass
-    Thread(target=waitpid_timeout_loop, name="Zombie hunter").start()
-
+    waitpid_timeout_loop()
+