Skip to content

Commit

Permalink
RUM-3574 Start sending batches immediately after feature is initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
ncreated committed Apr 25, 2024
1 parent 79943d3 commit 7afd568
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Unreleased

- [IMPROVEMENT] Start sending data immediately after SDK is initialized. See [#1798][]

# 2.10.0 / 23-04-2024

- [IMPROVEMENT] Add image duplicate detection between sessions. See [#1747][]
Expand Down Expand Up @@ -639,6 +641,7 @@ Release `2.0` introduces breaking changes. Follow the [Migration Guide](MIGRATIO
[#1774]: https://github.com/DataDog/dd-sdk-ios/pull/1774
[#1763]: https://github.com/DataDog/dd-sdk-ios/pull/1763
[#1767]: https://github.com/DataDog/dd-sdk-ios/pull/1767
[#1798]: https://github.com/DataDog/dd-sdk-ios/pull/1798
[#1721]: https://github.com/DataDog/dd-sdk-ios/pull/1721
[#1747]: https://github.com/DataDog/dd-sdk-ios/pull/1747
[@00fa9a]: https://github.com/00FA9A
Expand Down
8 changes: 5 additions & 3 deletions DatadogCore/Sources/Core/Upload/DataUploadWorker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ internal class DataUploadWorker: DataUploadWorkerType {
self.maxBatchesPerUpload = maxBatchesPerUpload
self.featureName = featureName
self.telemetry = telemetry

self.readWork = DispatchWorkItem { [weak self] in
let readWorkItem = DispatchWorkItem { [weak self] in
guard let self = self else {
return
}
Expand All @@ -87,7 +86,10 @@ internal class DataUploadWorker: DataUploadWorkerType {
self.scheduleNextCycle()
}
}
scheduleNextCycle()
self.readWork = readWorkItem

// Start sending batches immediately after initialization:
queue.async(execute: readWorkItem)
}

private func scheduleNextCycle() {
Expand Down

0 comments on commit 7afd568

Please sign in to comment.