Browse Source

global

master
zeus 4 years ago
parent
commit
09d6dea31d
  1. 40
      swarmlab-app/src/run/app.js

40
swarmlab-app/src/run/app.js

@ -201,26 +201,17 @@ global.pipelines=[];
// } // }
//} //}
} }
function onWatcherReady(){ function onlogfile(path){
console.info('From here can you check for real changes, the initial scan has been completed.');
}
// Declare the listeners of the watcher
watcher
.on('add', function(path) {
console.log('File', path, 'has been added'); console.log('File', path, 'has been added');
var pathfileval = pathmodule.basename(path); var pathfileval = pathmodule.basename(path);
//console.log('Filepath1 ', pathfileval, ' check'); var arrfile = pathfileval.toString().split("-");
var arrfile = pathfileval.toString().split("-");
var pathfile = arrfile[0]; var pathfile = arrfile[0];
//console.log('Filepath ', pathfile, ' check'); var indexfind1 = global.pipelines.findIndex(x => x.pathlogfile==pathfileval);
// /var/lab/playground-serverlogs/ondemand_playgroundnodejs_masterJPMqt1Jr-RgpMZFwJ-log if (indexfind1 === -1 ){
// ondemand_playgroundnodejs_masterPQvbrWga-AQxgfnSJ-output
(async() => { (async() => {
var token = "d2539e5a7ae1f9f1b0eb2b8f22ca467a86d28407"; // desto var token = "d2539e5a7ae1f9f1b0eb2b8f22ca467a86d28407"; // desto
var resdata = await getpipelines(token,pathfile) var resdata = await getpipelines(token,pathfile)
//console.log('info-------->>>>>>>>>>>> ', JSON.stringify(resdata));
//console.log('info----------------------- ', JSON.stringify(resdata.data));
//resdata.data.pathlogfile = 'test' //resdata.data.pathlogfile = 'test'
var resob = {} var resob = {}
resob.pathlogfile = pathfileval resob.pathlogfile = pathfileval
@ -243,28 +234,9 @@ global.pipelines=[];
//console.log('info', JSON.stringify(resdata)); //console.log('info', JSON.stringify(resdata));
//console.log('info------------- ', JSON.stringify(global.pipelines)); //console.log('info------------- ', JSON.stringify(global.pipelines));
})() })()
}) }
.on('addDir', function(path) {
console.log('Directory', path, 'has been added');
})
.on('change', function(path) {
console.log('File', path, 'has been changed');
})
.on('unlink', function(path) {
console.log('File', path, 'has been removed');
})
.on('unlinkDir', function(path) {
console.log('Directory', path, 'has been removed');
})
.on('error', function(error) {
console.log('Error happened', error);
})
.on('ready', onWatcherReady)
.on('raw', function(event, path, details) {
// This event should be triggered everytime something happens.
console.log('Raw event info:', event, path, details);
});
}
// *************************************************** // ***************************************************
// rest get // rest get

Loading…
Cancel
Save