Assign the recursive output of _thread_func to response to make sure that the latest response is always returned - that means the successful response in case the previous one was a failure

This commit is contained in:
Fabio Manganiello 2018-04-22 21:26:53 +02:00
parent 60c9c7476e
commit 6ef97e9ddc

View file

@ -197,8 +197,7 @@ class Request(Message):
if n_tries:
logging.info('Reloading plugin {} and retrying'.format(module_name))
get_plugin(module_name, reload=True)
_thread_func(n_tries-1)
return
response = _thread_func(n_tries-1)
finally:
self._send_response(response)
return response