Merge pull request #242 from jaseg/master
Random filename generation fix, made a windows-only delay actually windows-only.
This commit is contained in:
commit
f33af4700b
|
@ -112,7 +112,7 @@ exports.doImport = function(req, res, padId)
|
||||||
//convert file to text
|
//convert file to text
|
||||||
function(callback)
|
function(callback)
|
||||||
{
|
{
|
||||||
var randNum = Math.floor(Math.random()*new Date().getTime());
|
var randNum = Math.floor(Math.random()*0xFFFFFFFF);
|
||||||
destFile = tempDirectory + "eplite_import_" + randNum + ".txt";
|
destFile = tempDirectory + "eplite_import_" + randNum + ".txt";
|
||||||
abiword.convertFile(srcFile, destFile, "txt", callback);
|
abiword.convertFile(srcFile, destFile, "txt", callback);
|
||||||
},
|
},
|
||||||
|
@ -136,10 +136,13 @@ exports.doImport = function(req, res, padId)
|
||||||
|
|
||||||
//node on windows has a delay on releasing of the file lock.
|
//node on windows has a delay on releasing of the file lock.
|
||||||
//We add a 100ms delay to work around this
|
//We add a 100ms delay to work around this
|
||||||
setTimeout(function()
|
if(os.type().indexOf("Windows") > -1)
|
||||||
{
|
{
|
||||||
callback(err);
|
setTimeout(function()
|
||||||
}, 100);
|
{
|
||||||
|
callback(err);
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue