Skip to content

Commit 5de3bc9

Browse files
committed
Removing dispatch async calls for certain blocks of code
1 parent ac9705e commit 5de3bc9

8 files changed

Lines changed: 4 additions & 12 deletions

File tree

IFTTT SDK/ConnectionsMonitor.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ class ConnectionsMonitor: SynchronizationSubscriber {
6464
let startingCount = connections.count
6565

6666
let completionOperation = BlockOperation {
67-
DispatchQueue.main.async {
68-
completion(self.connectionsRegistry.getConnectionsCount() == startingCount, error)
69-
}
67+
completion(self.connectionsRegistry.getConnectionsCount() == startingCount, error)
7068
}
7169

7270
let credentialProvider = UserAuthenticatedRequestCredentialProvider()

IFTTT SDK/ConnectionsSynchronizer.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,7 @@ private class NativeServicesCoordinator {
296296
}
297297

298298
func processConnectionUpdate(_ updates: Set<Connection.ConnectionStorage>) {
299-
DispatchQueue.main.async {
300-
self.permissionsRequestor.processUpdate(with: updates)
301-
self.locationService.updateRegions(from: updates)
302-
}
299+
permissionsRequestor.processUpdate(with: updates)
300+
locationService.updateRegions(from: updates)
303301
}
304302
}

IFTTT SDK/LocationService.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ class RegionEventsSessionManager {
118118
if retryCount < numberOfRetries {
119119
let count = retryCount + 1
120120
ConnectButtonController.synchronizationLog("Failed to upload region events: \(events). Will retry \(numberOfRetries - retryCount) more times.")
121+
121122
DispatchQueue.main.asyncAfter(deadline: .now() + self.exponentialBackoffTiming(for: count)) {
122123
self.upload(events: events,
123124
credentialProvider: credentialProvider,

SDKHostApp/AppDelegate.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// AppDelegate.swift
33
// SDKHostApp
44
//
5-
// Created by Siddharth Sathyam on 12/11/20.
65
// Copyright © 2020 IFTTT. All rights reserved.
76
//
87

SDKHostApp/ContentView.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// ContentView.swift
33
// SDKHostApp
44
//
5-
// Created by Siddharth Sathyam on 12/11/20.
65
// Copyright © 2020 IFTTT. All rights reserved.
76
//
87

SDKHostApp/SceneDelegate.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// SceneDelegate.swift
33
// SDKHostApp
44
//
5-
// Created by Siddharth Sathyam on 12/11/20.
65
// Copyright © 2020 IFTTT. All rights reserved.
76
//
87

SDKHostAppTests/ArrayHelpersTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// ArrayHelpersTests.swift
33
// SDKHostAppTests
44
//
5-
// Created by Siddharth Sathyam on 12/14/20.
65
// Copyright © 2020 IFTTT. All rights reserved.
76
//
87

SDKHostAppUITests/SDKHostAppUITests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// SDKHostAppUITests.swift
33
// SDKHostAppUITests
44
//
5-
// Created by Siddharth Sathyam on 12/11/20.
65
// Copyright © 2020 IFTTT. All rights reserved.
76
//
87

0 commit comments

Comments
 (0)