Intercept SystemExit and do nothing so we could kill the thread

This commit is contained in:
allegroai 2020-04-09 12:33:16 +03:00
parent 5ec4d80493
commit b3c9872a3f
2 changed files with 3 additions and 3 deletions

View File

@ -243,6 +243,8 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
# we do not want to wait for the check version thread,
# because someone might wait for us to finish the repo detection update
except SystemExit:
pass
except Exception as e:
get_logger('task').debug(str(e))

View File

@ -1212,8 +1212,6 @@ class Task(_Task):
:return: Logger object
"""
pass
if not self._logger:
# force update of base logger to this current task (this is the main logger task)
self._setup_log(replace_existing=self.is_main_task())
@ -1456,7 +1454,7 @@ class Task(_Task):
if self._detect_repo_async_thread.is_alive():
self.log.info('Repository and package analysis timed out ({} sec), '
'giving up'.format(timeout))
# fone waiting, kill the thread
# done waiting, kill the thread
from .utilities.os.lowlevel import kill_thread
kill_thread(self._detect_repo_async_thread)
else: