clusterpost-execution
Version:
Download data from the data provider to the local disk. Submit tasks to the job manager. Check if the task has finished and upload the results back to the data provider
25 lines (20 loc) • 697 B
JavaScript
module.exports = function(doc, conf){
var executionmethods = require('./executionserver.methods')(conf);
var clusterengine = require("./" + conf.engine)(conf);
if(doc.jobstatus){
return clusterengine.killJob(doc)
.then(function(status){
if(doc.jobstatus.status === "RUN" || doc.jobstatus.status === "KILL"){
doc.jobstatus.status = status.status;
return executionmethods.uploadDocumentDataProvider(doc)
.then(function(){
return status;
});
}
});
}else{
return {
status: 'The job is not running'
};
}
}