move open group polling to background thread

pull/541/head
Ryan Zhao 2 years ago
parent a8fd6d9d18
commit 6c64d580b8

@ -23,11 +23,15 @@ public final class OpenGroupPollerV2 : NSObject {
guard let strongSelf = self else { return }
strongSelf.hasStarted = true
strongSelf.timer = Timer.scheduledTimer(withTimeInterval: strongSelf.pollInterval, repeats: true) { _ in
DispatchQueue.global().async {
self?.poll().retainUntilComplete()
}
}
DispatchQueue.global().async {
strongSelf.poll().retainUntilComplete()
}
}
}
@objc public func stop() {
timer?.invalidate()

Loading…
Cancel
Save