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

View file

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