Unverified Commit 54ed2b93 authored by J-shang's avatar J-shang Committed by GitHub
Browse files

detached tuner process under windows (#3218)

parent f1013390
...@@ -170,7 +170,7 @@ class Experiment: ...@@ -170,7 +170,7 @@ class Experiment:
while True: while True:
time.sleep(10) time.sleep(10)
status = self.get_status() status = self.get_status()
if status == 'STOPPED': if status == 'DONE' or status == 'STOPPED':
return True return True
if status == 'ERROR': if status == 'ERROR':
return False return False
......
...@@ -344,16 +344,19 @@ function getTunerProc(command: string, stdio: StdioOptions, newCwd: string, newE ...@@ -344,16 +344,19 @@ function getTunerProc(command: string, stdio: StdioOptions, newCwd: string, newE
let cmd: string = command; let cmd: string = command;
let arg: string[] = []; let arg: string[] = [];
let newShell: boolean = true; let newShell: boolean = true;
let isDetached: boolean = false;
if (process.platform === "win32") { if (process.platform === "win32") {
cmd = command.split(" ", 1)[0]; cmd = command.split(" ", 1)[0];
arg = command.substr(cmd.length + 1).split(" "); arg = command.substr(cmd.length + 1).split(" ");
newShell = false; newShell = false;
isDetached = true;
} }
const tunerProc: ChildProcess = spawn(cmd, arg, { const tunerProc: ChildProcess = spawn(cmd, arg, {
stdio, stdio,
cwd: newCwd, cwd: newCwd,
env: newEnv, env: newEnv,
shell: newShell shell: newShell,
detached: isDetached
}); });
return tunerProc; return tunerProc;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment