Revert external ID cache
It make more sense to include the commit SHA-1 of the notes branch from which the external IDs have been read into the cache key. This makes it easier to implement this cache within a multimaster setup. However, obviously, we can include the commit SHA-1 of the notes branch into the cache key only after the external IDs have been migrated to NoteDb (because before this the notes branch does not exist yet). Revert the cache for now and re-add an improved version of the cache later with the change that implements the migration of the external IDs to NoteDb. This reverts the following commits: -2869caaf70: Add cache for external ids -48d5c9b9aa: Make ExternalIdCacheImpl.AllKey public -20e5507d46: ExternalIdCache: Add method to get external IDs by account ID + scheme Change-Id: I589242aad32a9c70718542ba950c0a351c594e54 Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
@@ -73,7 +73,6 @@ public class CreateAccount
|
||||
private final AccountLoader.Factory infoLoader;
|
||||
private final DynamicSet<AccountExternalIdCreator> externalIdCreators;
|
||||
private final AuditService auditService;
|
||||
private final ExternalIdCache externalIdCache;
|
||||
private final String username;
|
||||
|
||||
@Inject
|
||||
@@ -88,7 +87,6 @@ public class CreateAccount
|
||||
AccountLoader.Factory infoLoader,
|
||||
DynamicSet<AccountExternalIdCreator> externalIdCreators,
|
||||
AuditService auditService,
|
||||
ExternalIdCache externalIdCache,
|
||||
@Assisted String username) {
|
||||
this.db = db;
|
||||
this.currentUser = currentUser;
|
||||
@@ -101,7 +99,6 @@ public class CreateAccount
|
||||
this.infoLoader = infoLoader;
|
||||
this.externalIdCreators = externalIdCreators;
|
||||
this.auditService = auditService;
|
||||
this.externalIdCache = externalIdCache;
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
@@ -156,7 +153,6 @@ public class CreateAccount
|
||||
|
||||
try {
|
||||
db.accountExternalIds().insert(externalIds);
|
||||
externalIdCache.onCreate(externalIds);
|
||||
} catch (OrmDuplicateKeyException duplicateKey) {
|
||||
throw new ResourceConflictException(
|
||||
"username '" + username + "' already exists");
|
||||
@@ -168,11 +164,9 @@ public class CreateAccount
|
||||
extMailto.setEmailAddress(input.email);
|
||||
try {
|
||||
db.accountExternalIds().insert(Collections.singleton(extMailto));
|
||||
externalIdCache.onCreate(extMailto);
|
||||
} catch (OrmDuplicateKeyException duplicateKey) {
|
||||
try {
|
||||
db.accountExternalIds().delete(Collections.singleton(extUser));
|
||||
externalIdCache.onRemove(extUser);
|
||||
} catch (OrmException cleanupError) {
|
||||
// Ignored
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user