[FIX] server.py: stop the FSWatcher when stopping the server

Avoid potential tracebacks from the FSWatcher's thread being killed.

Drawback: Server shut down can have an extra small delay

(only applies when the --dev=reload option is given)

closes odoo/odoo#31855

Signed-off-by: Christophe Simonis <chs@odoo.com>
This commit is contained in:
Denis Vermylen
2019-03-15 14:18:11 +00:00
parent 7b6cfc412e
commit 744bdd275e
+2 -2
View File
@@ -1019,10 +1019,10 @@ def start(preload=None, stop=False):
rc = server.run(preload, stop)
if watcher:
watcher.stop()
# like the legend of the phoenix, all ends with beginnings
if getattr(odoo, 'phoenix', False):
if watcher:
watcher.stop()
_reexec()
return rc if rc else 0