|
@@ -39,8 +39,13 @@ setInterval(function() {
|
|
|
logger.log({ err }, 'error writing cache file')
|
|
logger.log({ err }, 'error writing cache file')
|
|
|
return fs.unlink(cacheFsPathTmp)
|
|
return fs.unlink(cacheFsPathTmp)
|
|
|
} else {
|
|
} 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)
|
|
}, 30 * OneMinute)
|