ImportHandler: early return by condition inversion

No functional changes
pull/3509/head
muxator 2018-10-31 23:28:52 +01:00
parent df15daac0e
commit 49a7572cee
1 changed files with 14 additions and 12 deletions

View File

@ -285,20 +285,22 @@ exports.doImport = function(req, res, padId)
//clean up temporary files //clean up temporary files
function(callback) { function(callback) {
if(!directDatabaseAccess){ 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{
callback(); 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) { ], function(err) {
var status = "ok"; var status = "ok";