Remove redundant account updates
In two places we updated an account with an atomic update and then we updated it once more with a normal update. Change-Id: I4234a623600764201ff8a4c53786f6ba312072f9 Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
committed by
David Pursehouse
parent
d11fadd64d
commit
3f221dc596
@@ -28,7 +28,6 @@ import com.google.inject.Inject;
|
||||
import com.google.inject.Provider;
|
||||
import com.google.inject.Singleton;
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
@RequiresCapability(GlobalCapability.MODIFY_ACCOUNT)
|
||||
@@ -69,7 +68,6 @@ public class PutActive implements RestModifyView<AccountResource, Input> {
|
||||
if (a == null) {
|
||||
throw new ResourceNotFoundException("account not found");
|
||||
}
|
||||
dbProvider.get().accounts().update(Collections.singleton(a));
|
||||
byIdCache.evict(a.getId());
|
||||
return alreadyActive.get() ? Response.ok("") : Response.created("");
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ import com.google.inject.Inject;
|
||||
import com.google.inject.Provider;
|
||||
import com.google.inject.Singleton;
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
@Singleton
|
||||
@@ -79,7 +78,6 @@ public class PutPreferred implements RestModifyView<AccountResource.Email, Input
|
||||
if (a == null) {
|
||||
throw new ResourceNotFoundException("account not found");
|
||||
}
|
||||
dbProvider.get().accounts().update(Collections.singleton(a));
|
||||
byIdCache.evict(a.getId());
|
||||
return alreadyPreferred.get() ? Response.ok("") : Response.created("");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user