Don't join self._thread on stop in RunnablePlugin if self._thread = current_thread

This commit is contained in:
Fabio Manganiello 2023-03-11 23:45:46 +01:00
parent 31552963c4
commit 4a8da80c7c
Signed by: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -126,7 +126,11 @@ class RunnablePlugin(Plugin):
Stop the plugin.
"""
self._should_stop.set()
if self._thread and self._thread.is_alive():
if (
self._thread
and self._thread != threading.current_thread()
and self._thread.is_alive()
):
self.logger.info('Waiting for the plugin to stop')
try:
if self._thread: