mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-04-11 03:36:51 +02:00
stabilize NSProgress when lightweight migration falls back to InferredMappingModel
This commit is contained in:
@@ -708,9 +708,9 @@ public extension DataStack {
|
|||||||
var fakeProgress: Float = 0
|
var fakeProgress: Float = 0
|
||||||
|
|
||||||
var recursiveCheck: () -> Void = {}
|
var recursiveCheck: () -> Void = {}
|
||||||
recursiveCheck = {
|
recursiveCheck = { [weak timerQueue] in
|
||||||
|
|
||||||
guard fakeProgress < 1 else {
|
guard let timerQueue = timerQueue, fakeProgress < 1 else {
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,10 @@ internal final class MigrationManager: NSMigrationManager, ProgressReporting {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
let progress = self.progress
|
let progress = self.progress
|
||||||
progress.completedUnitCount = Int64(Float(progress.totalUnitCount) * self.migrationProgress)
|
progress.completedUnitCount = max(
|
||||||
|
progress.completedUnitCount,
|
||||||
|
Int64(Float(progress.totalUnitCount) * self.migrationProgress)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user