You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// It is recommended you call this method before accessing any data, as it will offer you an opportunity to show a loading screen during potentially long migrations, rather than leaving it for the first read or write on the data store.
55
64
///
56
65
/// - Parameter progressHandler: A closure that will be regularly called with progress during the migration. If no migration needs to occur, it won't be called, so setup and tear down any UI within the handler.
// TODO: Migrate any incompatible indexes by calling the internal methods below as needed.
90
+
awaitTask.yield() // The "work"
91
+
92
+
forhandlerin warmupProgressHandlers {
93
+
handler(.complete(total:0))
94
+
}
95
+
96
+
warmupProgressHandlers.removeAll()
97
+
warmupStatus =.complete
98
+
}
99
+
warmupStatus =.inProgress(warmupTask)
100
+
tryawait warmupTask.value
101
+
}
102
+
}
103
+
}
104
+
105
+
extensionDatastorewhere AccessMode ==ReadWrite{
61
106
/// Manually migrate an index if the version persisted is less than a given minimum version.
62
107
///
63
108
/// Only use this if you must force an index to be re-calculated, which is sometimes necessary when the implementation of the compare method changes between releases.
@@ -66,8 +111,48 @@ public actor Datastore<
66
111
/// - index: The index to migrate.
67
112
/// - minimumVersion: The minimum valid version for an index to not be migrated.
68
113
/// - progressHandler: A closure that will be regularly called with progress during the migration. If no migration needs to occur, it won't be called, so setup and tear down any UI within the handler.
// TODO: Migrate just that index, use indexMigrationStatus and indexMigrationProgressHandlers to record progress.
71
156
}
72
157
73
158
/// Manually migrate the entire store if the primary index version persisted is less than a given minimum version.
@@ -77,8 +162,12 @@ public actor Datastore<
77
162
/// - Parameters:
78
163
/// - minimumVersion: The minimum valid version for an index to not be migrated.
79
164
/// - progressHandler: A closure that will be regularly called with progress during the migration. If no migration needs to occur, it won't be called, so setup and tear down any UI within the handler.
0 commit comments