mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Reduce device link fetching timeout
This commit is contained in:
parent
59eb516973
commit
948d2d5066
1 changed files with 5 additions and 3 deletions
|
@ -1250,8 +1250,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
}
|
||||
|
||||
// Loki: Update device links in a blocking way
|
||||
// TODO: This is pretty bad for performance...
|
||||
// The envelope source is set during UD decryption.
|
||||
// FIXME: This is horrible for performance
|
||||
// FIXME: ========
|
||||
// The envelope source is set during UD decryption
|
||||
if ([ECKeyPair isValidHexEncodedPublicKeyWithCandidate:envelope.source] && dataMessage.publicChatInfo == nil) { // Handled in LokiPublicChatPoller for open group messages
|
||||
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
|
||||
[[LKMultiDeviceProtocol updateDeviceLinksIfNeededForHexEncodedPublicKey:envelope.source in:transaction].ensureOn(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^() {
|
||||
|
@ -1259,8 +1260,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
}).catchOn(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(NSError *error) {
|
||||
dispatch_semaphore_signal(semaphore);
|
||||
}) retainUntilComplete];
|
||||
dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, 10 * NSEC_PER_SEC));
|
||||
dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, 4 * NSEC_PER_SEC));
|
||||
}
|
||||
// FIXME: ========
|
||||
|
||||
if (groupId.length > 0) {
|
||||
NSMutableSet *newMemberIds = [NSMutableSet setWithArray:dataMessage.group.members];
|
||||
|
|
Loading…
Reference in a new issue