Don't wait until the previous callback finish is kill failed (#1036)

Such wait was happening in the main thread and blocking HA loop.
After all the executor thread was doing absolutely the same.
This commit is contained in:
Alexander Kukushkin
2019-04-15 15:49:06 +02:00
committed by GitHub
parent 74893e7b84
commit 51b085a76d
2 changed files with 1 additions and 3 deletions
-2
View File
@@ -24,8 +24,6 @@ class CallbackExecutor(Thread):
logger.warning('Killed the old callback process because it was still running: %s', self._cmd)
except OSError:
logger.exception('Failed to kill the old callback')
logger.warning('Wait until callback end')
self._process.wait()
self._cmd = cmd
self._callback_event.set()
+1 -1
View File
@@ -18,7 +18,7 @@ class TestCallbackExecutor(unittest.TestCase):
self.assertIsNone(ce.call([]))
mock_popen.return_value.kill.side_effect = OSError
self.assertRaises(Exception, ce.call, [])
self.assertIsNone(ce.call([]))
mock_popen.side_effect = Exception
ce = CallbackExecutor()