Skip to content

Commit

Permalink
Merge pull request #160 from julianpoy/lc-import-cleanup
Browse files Browse the repository at this point in the history
Better memory cleanup for lcb import
  • Loading branch information
julianpoy authored Feb 14, 2019
2 parents b2903e1 + 89240bd commit 215045a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Backend/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,9 @@ router.post(
})
})
})).then(() => {
sqliteDB.close()
try {
sqliteDB.close()
} catch(e){}
fs.removeSync(zipPath)
fs.removeSync(extractPath)

Expand All @@ -507,12 +509,18 @@ router.post(
})
})
}).catch(e => {
try {
sqliteDB.close()
} catch (e) {}
fs.removeSync(zipPath)
fs.removeSync(extractPath)
console.log("Couldn't handle lcb upload 1", e)
next(e);
})
} catch(e) {
try {
sqliteDB.close()
} catch (e) {}
fs.removeSync(zipPath)
fs.removeSync(extractPath)
console.log("Couldn't handle lcb upload 2", e)
Expand Down

0 comments on commit 215045a

Please sign in to comment.