Fix node deprecation warning about calling fs.writeFile without cb

This commit is contained in:
Calvin Montgomery 2017-04-04 23:12:02 -07:00
parent 8306d2d1b6
commit 25c663c110
1 changed files with 6 additions and 2 deletions

View File

@ -48,8 +48,12 @@ function getTorIPs(cb) {
retrieveIPs(function (err, ips) {
if (!err) {
cb(false, ips);
fs.writeFile(path.join(__dirname, "..", "torlist"),
ips.join("\n"));
const destination = path.join(__dirname, "..", "torlist");
fs.writeFile(destination,
ips.join("\n"),
error => {
LOGGER.error("Failed to write to %s: %s", destination, error.stack);
});
return;
}