Optimizations (#4135)
* removes costly json serialization to InMemoryCacheAdapter * Always cache a copy of the array * Use own mapValues * Makes sure we dont make unnecessary calls to the logger * Do not bypass loggers with silent logging (only applies to stdout) * warn is not warning * use === * Wrap logRequest / logResponse in the loggerController for more granular control Also give the ability to pass functions to the logger so we don't serialize too early in JSON (costly) * reconfiguring winston would override the transports levels and make subsequent tests fail
This commit is contained in:
@@ -135,7 +135,7 @@ Auth.prototype._loadRoles = function() {
|
||||
this.fetchedRoles = true;
|
||||
this.rolePromise = null;
|
||||
|
||||
cacheAdapter.role.put(this.user.id, this.userRoles);
|
||||
cacheAdapter.role.put(this.user.id, Array(...this.userRoles));
|
||||
return Promise.resolve(this.userRoles);
|
||||
}
|
||||
var rolesMap = results.reduce((m, r) => {
|
||||
@@ -152,8 +152,7 @@ Auth.prototype._loadRoles = function() {
|
||||
});
|
||||
this.fetchedRoles = true;
|
||||
this.rolePromise = null;
|
||||
|
||||
cacheAdapter.role.put(this.user.id, this.userRoles);
|
||||
cacheAdapter.role.put(this.user.id, Array(...this.userRoles));
|
||||
return Promise.resolve(this.userRoles);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user