kopia lustrzana https://github.com/OpenDroneMap/NodeODM
Use ES6 let, change default port to 3000
rodzic
6e3624d5f8
commit
15bb8962d2
|
@ -14,7 +14,7 @@
|
|||
* @property {number} port Port to launch server on
|
||||
*/
|
||||
|
||||
var config = {};
|
||||
let config = {};
|
||||
|
||||
// Instance name - default name for this configuration (will be server process name)
|
||||
config.instance = 'node-OpenDroneMap';
|
||||
|
@ -28,7 +28,7 @@ config.logger.maxFiles = 10; // Max number of log files kept
|
|||
config.logger.logDirectory = ''; // Set this to a full path to a directory - if not set logs will be written to the application directory.
|
||||
|
||||
// Server port
|
||||
config.port = process.env.PORT || 8081;
|
||||
config.port = process.env.PORT || 3000;
|
||||
// process.env.PORT is what AWS Elastic Beanstalk defines
|
||||
// on IBM bluemix use config.port = process.env.VCAP_APP_PORT || 8081;
|
||||
|
||||
|
|
6
index.js
6
index.js
|
@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/
|
||||
"use strict";
|
||||
|
||||
var config = require('./config.js')
|
||||
let config = require('./config.js')
|
||||
|
||||
let logger = require('winston');
|
||||
let fs = require('fs');
|
||||
|
@ -34,7 +34,7 @@ let morgan = require('morgan');
|
|||
|
||||
// Set up logging
|
||||
// Configure custom File transport to write plain text messages
|
||||
var logPath = ( config.logger.logDirectory ? config.logger.logDirectory : __dirname );
|
||||
let logPath = ( config.logger.logDirectory ? config.logger.logDirectory : __dirname );
|
||||
// Check that log file directory can be written to
|
||||
try {
|
||||
fs.accessSync(logPath, fs.W_OK);
|
||||
|
@ -56,7 +56,7 @@ logger
|
|||
// Console transport is no use to us when running as a daemon
|
||||
.remove(logger.transports.Console);
|
||||
|
||||
var winstonStream = {
|
||||
let winstonStream = {
|
||||
write: function(message, encoding){
|
||||
logger.info(message.slice(0, -1));
|
||||
}
|
||||
|
|
16
libs/Task.js
16
libs/Task.js
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Node-OpenDroneMap Node.js App and REST API to access OpenDroneMap.
|
||||
/*
|
||||
Node-OpenDroneMap Node.js App and REST API to access OpenDroneMap.
|
||||
Copyright (C) 2016 Node-OpenDroneMap Contributors
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
@ -57,7 +57,7 @@ module.exports = class Task{
|
|||
for (let k in taskJson){
|
||||
task[k] = taskJson[k];
|
||||
}
|
||||
|
||||
|
||||
// Tasks that were running should be put back to QUEUED state
|
||||
if (task.status.code === statusCodes.RUNNING){
|
||||
task.status.code = statusCodes.QUEUED;
|
||||
|
@ -94,13 +94,13 @@ module.exports = class Task{
|
|||
this.status = {
|
||||
code: code
|
||||
};
|
||||
for (var k in extra){
|
||||
for (let k in extra){
|
||||
this.status[k] = extra[k];
|
||||
}
|
||||
}
|
||||
|
||||
updateProcessingTime(resetTime){
|
||||
this.processingTime = resetTime ?
|
||||
this.processingTime = resetTime ?
|
||||
-1 :
|
||||
new Date().getTime() - this.dateCreated;
|
||||
}
|
||||
|
@ -135,12 +135,12 @@ module.exports = class Task{
|
|||
if (this.status.code !== statusCodes.CANCELED){
|
||||
let wasRunning = this.status.code === statusCodes.RUNNING;
|
||||
this.setStatus(statusCodes.CANCELED);
|
||||
|
||||
|
||||
if (wasRunning && this.runnerProcess){
|
||||
// TODO: this does guarantee that
|
||||
// the process will immediately terminate.
|
||||
// In fact, often times ODM will continue running for a while
|
||||
// This might need to be fixed on ODM's end.
|
||||
// This might need to be fixed on ODM's end.
|
||||
this.runnerProcess.kill('SIGINT');
|
||||
this.runnerProcess = null;
|
||||
}
|
||||
|
@ -262,4 +262,4 @@ module.exports = class Task{
|
|||
options: this.options
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
@ -207,7 +207,7 @@ module.exports = class TaskManager{
|
|||
// Serializes the list of tasks and saves it
|
||||
// to disk
|
||||
dumpTaskList(done){
|
||||
var output = [];
|
||||
let output = [];
|
||||
|
||||
for (let uuid in this.tasks){
|
||||
output.push(this.tasks[uuid].serialize());
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
var uuid = require('node-uuid');
|
||||
let uuid = require('node-uuid');
|
||||
|
||||
module.exports = function (options) {
|
||||
options = options || {};
|
||||
|
@ -14,4 +14,4 @@ module.exports = function (options) {
|
|||
}
|
||||
next();
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Ładowanie…
Reference in New Issue