Commit 2bee595b authored by Vytor Calixto's avatar Vytor Calixto 👾
Browse files

Try catch ao deletar os arquivos

parent 13c62a18
......@@ -24,14 +24,19 @@ Arquivo.remove({}, function(err) {
} catch(e) {
log.error(e)
}
if(files.length > 0) {
for(var i = 0; i < files.length; i++) {
var filePath = dir + files[i]
if(fs.statSync(filePath).isFile()) {
fs.unlinkSync(filePath)
try {
if(files.length > 0) {
for(var i = 0; i < files.length; i++) {
var filePath = dir + files[i]
if(fs.statSync(filePath).isFile()) {
fs.unlinkSync(filePath)
}
}
}
}
} catch(e) {
log.error(e)
}
})
Materia.remove({}, function(err) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment