File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed
AppSyncRealTimeClient/Websocket/Starscream Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -53,27 +53,29 @@ public class StarscreamAdapter: AppSyncWebsocketProvider {
5353 self . socket? . callbackQueue = self . callbackQueue
5454 self . socket? . connect ( )
5555 #if os(watchOS)
56- // On watchOS, if it takes longer than 5 seconds
57- // to connect, fail fast.
5856 AppSyncLogger . debug (
59- " [StarscreamAdapter] Starting connectivity timer for watchOS for 3s "
57+ " [StarscreamAdapter] Starting connectivity timer for watchOS for 3s. "
6058 )
6159 self . watchOSConnectivityTimer. start ( interval: 3 ) {
6260 AppSyncLogger . debug (
6361 " [StarscreamAdapter] watchOS connectivity timer is up. "
6462 )
65- if !self . _isConnected {
66- AppSyncLogger . debug (
67- " [StarscreamAdapter] watchOS subscriptions not connected after 3s. "
68- )
69- self . serialQueue. async {
63+ self . serialQueue. async {
64+ if !self . _isConnected {
65+ AppSyncLogger . debug (
66+ " [StarscreamAdapter] watchOS subscriptions not connected after 3s. "
67+ )
68+ AppSyncLogger . debug (
69+ " [StarscreamAdapter] Manually send disconnect. "
70+ )
7071 self . delegate? . websocketDidDisconnect ( provider: self , error: nil )
72+ } else {
73+ AppSyncLogger . debug (
74+ " [StarscreamAdapter] watchOS subscriptions are connected within 3s. "
75+ )
7176 }
72- } else {
73- AppSyncLogger . debug (
74- " [StarscreamAdapter] watchOS subscriptions are connected within 3s. "
75- )
7677 }
78+
7779 }
7880 #endif
7981 }
You can’t perform that action at this time.
0 commit comments