diff -r 76995a304fe0 -r da8cceaa247d Beremiz_service.py --- 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: