Merge pull request #1701 from thelounge/xpaw/sync-write
Go back to writing user files synchronously
This commit is contained in:
commit
1e7b398903
@ -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})`);
|
||||
}
|
||||
|
||||
if (callback) {
|
||||
callback(err);
|
||||
}
|
||||
});
|
||||
try {
|
||||
fs.writeFileSync(Helper.getUserConfigPath(name), newUser);
|
||||
} catch (e) {
|
||||
log.error(`Failed to update user ${colors.green(name)} (${e})`);
|
||||
throw e;
|
||||
}
|
||||
};
|
||||
|
||||
ClientManager.prototype.removeUser = function(name) {
|
||||
|
Loading…
Reference in New Issue
Block a user