Separate network and processing of profile fetches.

fork-5.53.8
Cody Henthorne 2021-12-21 15:57:35 -05:00 zatwierdzone przez Alex Hart
rodzic bbadda5656
commit 3eb8db00aa
1 zmienionych plików z 7 dodań i 2 usunięć

Wyświetl plik

@ -268,7 +268,6 @@ public class RetrieveProfileJob extends BaseJob {
ProfileService.ProfileResponseProcessor processor = new ProfileService.ProfileResponseProcessor(pair.second());
if (processor.hasResult()) {
state.profiles.add(processor.getResult(recipient));
process(recipient, processor.getResult());
} else if (processor.notFound()) {
Log.w(TAG, "Failed to find a profile for " + recipient.getId());
if (recipient.isRegistered()) {
@ -284,7 +283,13 @@ public class RetrieveProfileJob extends BaseJob {
.lastOrError()
.blockingGet();
stopwatch.split("network-process");
stopwatch.split("responses");
for (Pair<Recipient, ProfileAndCredential> profile : operationState.profiles) {
process(profile.first(), profile.second());
}
stopwatch.split("process");
Set<RecipientId> success = SetUtil.difference(recipientIds, operationState.retries);
recipientDatabase.markProfilesFetched(success, System.currentTimeMillis());