mirror of
https://github.com/thelounge/thelounge
synced 2024-11-27 06:20:26 +00:00
Go back to writing user files synchronously
This commit is contained in:
parent
5fd493bdc2
commit
9ff398dac3
1 changed files with 6 additions and 9 deletions
|
@ -140,15 +140,12 @@ ClientManager.prototype.updateUser = function(name, opts, callback) {
|
|||
return callback ? callback() : true;
|
||||
}
|
||||
|
||||
fs.writeFile(Helper.getUserConfigPath(name), newUser, (err) => {
|
||||
if (err) {
|
||||
log.error(`Failed to update user ${colors.green(name)}. (${err})`);
|
||||
try {
|
||||
fs.writeFileSync(Helper.getUserConfigPath(name), newUser);
|
||||
} catch (e) {
|
||||
log.error(`Failed to update user ${colors.green(name)} (${e})`);
|
||||
throw e;
|
||||
}
|
||||
|
||||
if (callback) {
|
||||
callback(err);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
ClientManager.prototype.removeUser = function(name) {
|
||||
|
|
Loading…
Reference in a new issue