perf(efficiency): 落实首批采样减负与发行包瘦身

This commit is contained in:
2026-11-03 23:19:52 +08:00
parent 935701fca6
commit def3b1e130
40 changed files with 483 additions and 291 deletions
+14
View File
@@ -0,0 +1,14 @@
import Foundation
/// Missing capabilities back off independently; success in another zone cannot reset this state.
nonisolated struct SensorSchedule {
private(set) var deadline: TimeInterval = 0
private var failures = 0
func isDue(at now: TimeInterval) -> Bool { now >= deadline }
mutating func complete(available: Bool, at now: TimeInterval) {
failures = available ? 0 : min(failures + 1, 5)
deadline = now + (available ? 10 : min(600, 60 * pow(2, Double(failures - 1))))
}
}