[ASpell] error handling of cache dump: fix an async fs function call

fs.unlink requires a callback as second parameter.

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>
This commit is contained in:
Jakob Ackermann 2019-10-21 01:54:59 +02:00 committed by Jakob Ackermann
parent ac6e70d064
commit 5cfd92cf85

View file

@ -39,7 +39,7 @@ const cacheDump = setInterval(function() {
return fs.writeFile(cacheFsPathTmp, dump, function(err) {
if (err != null) {
logger.log(OError.tag(err, 'error writing cache file'))
return fs.unlink(cacheFsPathTmp)
fs.unlink(cacheFsPathTmp, () => {})
} else {
fs.rename(cacheFsPathTmp, cacheFsPath, err => {
if (err) {