kopia lustrzana https://github.com/OpenDroneMap/NodeODM
commit
f70e78aa4e
|
@ -30,6 +30,7 @@ let processRunner = require('./processRunner');
|
|||
let archiver = require('archiver');
|
||||
let os = require('os');
|
||||
let Directories = require('./Directories');
|
||||
let kill = require('tree-kill');
|
||||
|
||||
let statusCodes = require('./statusCodes');
|
||||
|
||||
|
@ -195,7 +196,7 @@ module.exports = class Task{
|
|||
// the process will immediately terminate.
|
||||
// For eaxmple in the case of the ODM process, the process will continue running for a while
|
||||
// This might need to be fixed on ODM's end.
|
||||
proc.kill('SIGINT');
|
||||
kill(proc.pid);
|
||||
});
|
||||
this.runningProcesses = [];
|
||||
}
|
||||
|
|
|
@ -29,24 +29,26 @@ module.exports = {
|
|||
assert(projectName !== undefined, "projectName must be specified");
|
||||
assert(options["project-path"] !== undefined, "project-path must be defined");
|
||||
|
||||
let command = [path.join(config.odm_path, "run.py")];
|
||||
const command = path.join(config.odm_path, "run.sh"),
|
||||
params = [];
|
||||
|
||||
for (var name in options){
|
||||
let value = options[name];
|
||||
|
||||
// Skip false booleans
|
||||
if (value === false) continue;
|
||||
|
||||
command.push("--" + name);
|
||||
params.push("--" + name);
|
||||
|
||||
// We don't specify "--time true" (just "--time")
|
||||
if (typeof value !== 'boolean'){
|
||||
command.push(value);
|
||||
params.push(value);
|
||||
}
|
||||
}
|
||||
|
||||
command.push(projectName);
|
||||
params.push(projectName);
|
||||
|
||||
logger.info(`About to run: python ${command.join(" ")}`);
|
||||
logger.info(`About to run: ${command} ${params.join(" ")}`);
|
||||
|
||||
if (config.test){
|
||||
logger.info("Test mode is on, command will not execute");
|
||||
|
@ -68,7 +70,7 @@ module.exports = {
|
|||
}
|
||||
|
||||
// Launch
|
||||
let childProcess = spawn("python", command, {cwd: config.odm_path});
|
||||
let childProcess = spawn(command, params, {cwd: config.odm_path});
|
||||
|
||||
childProcess
|
||||
.on('exit', (code, signal) => done(null, code, signal))
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
"request": "^2.81.0",
|
||||
"rimraf": "^2.5.3",
|
||||
"swagger-jsdoc": "^1.3.1",
|
||||
"tree-kill": "^1.1.0",
|
||||
"unzip": "^0.1.11",
|
||||
"winston": "^2.2.0"
|
||||
},
|
||||
|
|
Ładowanie…
Reference in New Issue