Go back to writing user files synchronously
This commit is contained in:
parent
5fd493bdc2
commit
9ff398dac3
@ -140,15 +140,12 @@ ClientManager.prototype.updateUser = function(name, opts, callback) {
|
|||||||
return callback ? callback() : true;
|
return callback ? callback() : true;
|
||||||
}
|
}
|
||||||
|
|
||||||
fs.writeFile(Helper.getUserConfigPath(name), newUser, (err) => {
|
try {
|
||||||
if (err) {
|
fs.writeFileSync(Helper.getUserConfigPath(name), newUser);
|
||||||
log.error(`Failed to update user ${colors.green(name)}. (${err})`);
|
} catch (e) {
|
||||||
|
log.error(`Failed to update user ${colors.green(name)} (${e})`);
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (callback) {
|
|
||||||
callback(err);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ClientManager.prototype.removeUser = function(name) {
|
ClientManager.prototype.removeUser = function(name) {
|
||||||
|
Loading…
Reference in New Issue
Block a user