Default tasks to running on creation, bump version, fix exit code

pull/153/head
Piero Toffanin 2021-05-25 10:11:11 -04:00
rodzic 9bdf410e27
commit 7dca5efaee
4 zmienionych plików z 7 dodań i 5 usunięć

Wyświetl plik

@ -46,7 +46,7 @@ module.exports = class Task{
this.dateCreated = isNaN(parseInt(dateCreated)) ? new Date().getTime() : parseInt(dateCreated);
this.dateStarted = 0;
this.processingTime = -1;
this.setStatus(statusCodes.QUEUED);
this.setStatus(statusCodes.RUNNING);
this.options = options;
this.gcpFiles = [];
this.geoFiles = [];
@ -117,6 +117,8 @@ module.exports = class Task{
});
}
]), err => {
if (err) this.setStatus(statusCodes.FAILED, { errorMessage: err.message });
else this.setStatus(statusCodes.QUEUED);
this.initialized = true;
done(err, this);
});

Wyświetl plik

@ -71,7 +71,9 @@ module.exports = {
}
// Launch
let childProcess = spawn(command, params, {cwd: config.odm_path});
const env = utils.clone(process.env);
env.ODM_NONINTERACTIVE = 1;
let childProcess = spawn(command, params, {cwd: config.odm_path, env});
childProcess
.on('exit', (code, signal) => done(null, code, signal))

Wyświetl plik

@ -406,8 +406,6 @@ module.exports = {
task.initialize(err => {
if (err) {
task.setStatus(statusCodes.FAILED, { errorMessage: err.message });
// Cleanup
removeDirectory(srcPath);
removeDirectory(destPath);

Wyświetl plik

@ -1,6 +1,6 @@
{
"name": "NodeODM",
"version": "2.1.4",
"version": "2.1.5",
"description": "REST API to access ODM",
"main": "index.js",
"scripts": {