Skip to content

Commit

Permalink
Dispatching the next batch asynchronous in order to prevent Swift war…
Browse files Browse the repository at this point in the history
…nings (#187)
  • Loading branch information
brototyp authored Oct 2, 2017
1 parent e4ffd85 commit 46e89ad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion PiwikTracker/PiwikTracker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ final public class PiwikTracker: NSObject {
self.dispatcher.send(events: events, success: {
self.queue.remove(events: events, completion: {
self.logger.info("Dispatched batch of \(events.count) events.")
self.dispatchBatch()
DispatchQueue.main.async {
self.dispatchBatch()
}
})
}, failure: { error in
self.isDispatching = false
Expand Down

0 comments on commit 46e89ad

Please sign in to comment.