File tree Expand file tree Collapse file tree 1 file changed +2
-20
lines changed
LaunchDarkly/LaunchDarkly Expand file tree Collapse file tree 1 file changed +2
-20
lines changed Original file line number Diff line number Diff line change @@ -853,38 +853,20 @@ public class LDClient {
853853 let internalCompletedQueue : DispatchQueue = DispatchQueue ( label: " TimeOutQueue " )
854854 if !config. startOnline {
855855 start ( serviceFactory: serviceFactory, config: config, context: context)
856+ // Consider to wrap this into internalCompletedQueue to make completion return always consistent
856857 completion ? ( true ) // offline is considered a short circuited timed out case
857858 } else {
858- // let startTime = Date().timeIntervalSince1970
859-
860- TimeoutExecutor . run (
859+ TimeoutExecutor . run (
861860 timeout: startWaitSeconds,
862861 queue: internalCompletedQueue,
863862 operation: { done in
864863 start ( serviceFactory: serviceFactory, config: config, context: context) {
865- // let onTime = startWaitSeconds > Date().timeIntervalSince1970 - startTime
866864 done ( false )
867865 }
868866 } ,
869867 timeoutValue: true ,
870868 completion: completion
871869 )
872-
873- // var completed = false
874- // start(serviceFactory: serviceFactory, config: config, context: context) {
875- // internalCompletedQueue.async {
876- // if startTime + startWaitSeconds > Date().timeIntervalSince1970 && !completed {
877- // completed = true
878- // completion?(false) // false for not timedOut
879- // }
880- // }
881- // }
882- // internalCompletedQueue.asyncAfter(deadline: .now() + startWaitSeconds) {
883- // if !completed {
884- // completed = true
885- // completion?(true) // true for timedOut
886- // }
887- // }
888870 }
889871 }
890872
You can’t perform that action at this time.
0 commit comments