mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-16 14:06:53 +01: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 recursiveCheck: () -> Void = {}
|
||||
recursiveCheck = {
|
||||
recursiveCheck = { [weak timerQueue] in
|
||||
|
||||
guard fakeProgress < 1 else {
|
||||
guard let timerQueue = timerQueue, fakeProgress < 1 else {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -42,7 +42,10 @@ internal final class MigrationManager: NSMigrationManager, ProgressReporting {
|
||||
return
|
||||
}
|
||||
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