ImportHandler: early return by condition inversion

No functional changes
This commit is contained in:
muxator 2018-10-31 23:28:52 +01:00
parent df15daac0e
commit 49a7572cee

View file

@ -285,20 +285,22 @@ exports.doImport = function(req, res, padId)
//clean up temporary files
function(callback) {
if(!directDatabaseAccess){
//for node < 0.7 compatible
var fileExists = fs.exists || path.exists;
async.parallel([
function(callback){
fileExists (srcFile, function(exist) { (exist)? fs.unlink(srcFile, callback): callback(); });
},
function(callback){
fileExists (destFile, function(exist) { (exist)? fs.unlink(destFile, callback): callback(); });
}
], callback);
}else{
if (directDatabaseAccess) {
callback();
return;
}
//for node < 0.7 compatible
var fileExists = fs.exists || path.exists;
async.parallel([
function(callback){
fileExists (srcFile, function(exist) { (exist)? fs.unlink(srcFile, callback): callback(); });
},
function(callback){
fileExists (destFile, function(exist) { (exist)? fs.unlink(destFile, callback): callback(); });
}
], callback);
}
], function(err) {
var status = "ok";