Beremiz_service.py
changeset 3420 da8cceaa247d
parent 3282 725d3e9ac913
child 3426 c2c366964913
child 3440 3770ded5db5c
--- a/Beremiz_service.py	Thu Jan 20 11:16:52 2022 +0100
+++ b/Beremiz_service.py	Thu Jan 20 11:39:05 2022 +0100
@@ -32,6 +32,7 @@
 import threading
 import shlex
 import traceback
+import threading
 from threading import Thread, Semaphore, Lock, currentThread
 from builtins import str as text
 from past.builtins import execfile
@@ -46,6 +47,14 @@
 from runtime.Stunnel import ensurePSK
 import util.paths as paths
 
+# In case system time is ajusted, it is better to use
+# monotonic timers for timers and other timeout based operations.
+# hot-patch threading module to force using monitonic time for all 
+# Thread/Timer/Event/Condition
+
+from runtime.monotonic_time import monotonic
+threading._time = monotonic
+
 try:
     from runtime.spawn_subprocess import Popen
 except ImportError: