mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-21 02:28:06 +01:00
Fix CDS writer to use AccountsManager.
This commit is contained in:
committed by
gram-signal
parent
bd40e32f3b
commit
a064b25a14
@@ -491,7 +491,7 @@ public class WhisperServerService extends Application<WhisperServerConfiguration
|
||||
directoryServerConfiguration.getReplicationName(), directoryReconciliationClient);
|
||||
deletedAccountsDirectoryReconcilers.add(deletedAccountsDirectoryReconciler);
|
||||
}
|
||||
accountDatabaseCrawlerListeners.add(new ContactDiscoveryWriter(accounts));
|
||||
accountDatabaseCrawlerListeners.add(new ContactDiscoveryWriter(accountsManager));
|
||||
// PushFeedbackProcessor may update device properties
|
||||
accountDatabaseCrawlerListeners.add(new PushFeedbackProcessor(accountsManager));
|
||||
// delete accounts last
|
||||
|
||||
@@ -6,9 +6,9 @@ import java.util.UUID;
|
||||
|
||||
public class ContactDiscoveryWriter extends AccountDatabaseCrawlerListener {
|
||||
|
||||
private final AccountStore accounts;
|
||||
private final AccountsManager accounts;
|
||||
|
||||
public ContactDiscoveryWriter(final AccountStore accounts) {
|
||||
public ContactDiscoveryWriter(final AccountsManager accounts) {
|
||||
this.accounts = accounts;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ContactDiscoveryWriter extends AccountDatabaseCrawlerListener {
|
||||
// It’s less than ideal, but crawler listeners currently must not call update()
|
||||
// with the accounts from the chunk, because updates cause the account instance to become stale. Instead, they
|
||||
// must get a new copy, which they are free to update.
|
||||
accounts.get(account.getUuid()).ifPresent(accounts::update);
|
||||
accounts.get(account.getUuid()).ifPresent(a -> accounts.update(a, updated -> {}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user