Remove Registrar caching from all console actions

Caching turns out to be an anti-pattern for the console.  If we use it, changes from the user just get obliterated by the older, cached version the next time the console refreshes (and it happens to refresh after every update).  Caching is also not very useful here, as the amount of database access driven by the console is very small.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=190650931
This commit is contained in:
mmuller 2018-03-27 12:02:50 -07:00 committed by jianglai
parent 6dec95b980
commit e1ad4d663c
10 changed files with 12 additions and 18 deletions

View file

@ -59,8 +59,7 @@ public class SessionUtils {
* the registrar console.
*/
@CheckReturnValue
Registrar getRegistrarForAuthResult(
HttpServletRequest request, AuthResult authResult, boolean bypassCache) {
Registrar getRegistrarForAuthResult(HttpServletRequest request, AuthResult authResult) {
if (!authResult.userAuthInfo().isPresent()) {
throw new ForbiddenException("Not logged in");
}
@ -69,9 +68,7 @@ public class SessionUtils {
}
String clientId = getRegistrarClientId(request);
return checkArgumentPresent(
bypassCache
? Registrar.loadByClientId(clientId)
: Registrar.loadByClientIdCached(clientId),
Registrar.loadByClientId(clientId),
"Registrar %s not found",
clientId);
}