From f7a0c03590e1c927dc9592d3e83072f1946a3aa3 Mon Sep 17 00:00:00 2001 From: Felix Hamme Date: Tue, 18 Feb 2025 18:30:18 +0100 Subject: [PATCH] log exceptions in _autoTickThread and continue --- pysyncobj/syncobj.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pysyncobj/syncobj.py b/pysyncobj/syncobj.py index 2a43c7a..3b3d86e 100644 --- a/pysyncobj/syncobj.py +++ b/pysyncobj/syncobj.py @@ -534,7 +534,12 @@ def _autoTickThread(self): if self.__destroying: self._doDestroy() break - self._onTick(self.__conf.autoTickPeriod) + try: + self._onTick(self.__conf.autoTickPeriod) + except Exception: + # log, wait a little and retry + logger.exception('failed _onTick in _autoTickThread') + time.sleep(self.__conf.autoTickPeriod) except ReferenceError: pass