Skip to content

Commit

Permalink
Exempt resources having completed historical stage from the prioritiz…
Browse files Browse the repository at this point in the history
…ation mechanism
  • Loading branch information
andersio committed Dec 9, 2024
1 parent a59307d commit 8e6e319
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/VitalHealthKit/HealthKit/VitalHealthKitClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,12 @@ extension VitalHealthKitClient {
}

private func prioritizeSync(_ remappedResource: RemappedVitalResource, _ tags: Set<SyncContextTag>) -> Bool {
if storage.historicalStageDone(for: remappedResource) {
// Prioritization only affects historical stage.
// If the resource is done with historical stage, it should not be subject to prioritization.
return true
}

let priority = remappedResource.wrapped.priority
let prerequisites = VitalResource.all.filter { $0.priority < priority }

Expand Down

0 comments on commit 8e6e319

Please sign in to comment.