Skip to content
Snippets Groups Projects
Commit bec3abd6 authored by Christophe Simonis's avatar Christophe Simonis
Browse files

[FIX] restart of server on windows

bzr revid: chs@openerp.com-20121126122220-38s3hla3hyl1b15p
parent 452d1af6
No related branches found
No related tags found
No related merge requests found
......@@ -129,6 +129,7 @@ def start_services_workers():
def _reexec():
"""reexecute openerp-server process with (nearly) the same arguments"""
# TODO check if parent is a NT service
strip_args = ['-d', '-u']
a = sys.argv[:]
args = [x for i, x in enumerate(a) if x not in strip_args and a[max(i - 1, 0)] not in strip_args]
......@@ -141,9 +142,12 @@ def restart_server():
os.kill(pid, signal.SIGHUP)
else:
if os.name == 'nt':
# TODO check if parent is a service
stop_services()
_reexec()
def reborn():
stop_services()
_reexec()
# run in a thread to let the current thread return response to the caller.
threading.Thread(target=reborn).start()
else:
openerp.phoenix = True
os.kill(os.getpid(), signal.SIGINT)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment