Spelling fixes in log messages, made a delay windows-only which according to a comment should be windows-only, fixed a random filename generator.

This commit is contained in:
jaseg 2011-11-09 17:19:00 +01:00
parent bf0fe9377d
commit 4fc4a35381
3 changed files with 27 additions and 25 deletions

View file

@ -81,10 +81,9 @@ exports.doExport = function(req, res, padId, type)
res.send(html);
callback("stop");
}
//write the html export to a file
else
else //write the html export to a file
{
randNum = Math.floor(Math.random()*new Date().getTime());
randNum = Math.floor(Math.random()*0xFFFFFFFF);
srcFile = tempDirectory + "/eplite_export_" + randNum + ".html";
fs.writeFile(srcFile, html, callback);
}
@ -114,10 +113,13 @@ exports.doExport = function(req, res, padId, type)
function(callback)
{
//100ms delay to accomidate for slow windows fs
setTimeout(function()
{
fs.unlink(destFile, callback);
}, 100);
if(os.type().indexOf("Windows") > -1)
{
setTimeout(function()
{
fs.unlink(destFile, callback);
}, 100);
}
}
], callback);
}