fixed renaming missing callback (#28)

This commit is contained in:
Miguel Serrano 2019-07-05 10:30:43 +01:00 committed by GitHub
parent 46d0cf9c4b
commit ba642b9807

View file

@ -39,8 +39,13 @@ setInterval(function() {
logger.log({ err }, 'error writing cache file')
return fs.unlink(cacheFsPathTmp)
} else {
fs.rename(cacheFsPathTmp, cacheFsPath)
return logger.log({ len: dump.length, cacheFsPath }, 'wrote cache file')
fs.rename(cacheFsPathTmp, cacheFsPath, err => {
if (err) {
logger.error({ err }, 'error renaming cache file')
} else {
logger.log({ len: dump.length, cacheFsPath }, 'wrote cache file')
}
})
}
})
}, 30 * OneMinute)