Fix incremental backup exports.

pull/1/head
Matthew Chen 7 years ago
parent fe8259bf0c
commit 9a123d8ce9

@ -77,6 +77,10 @@ NS_ASSUME_NONNULL_BEGIN
actionBlock:^{ actionBlock:^{
[DebugUIBackup logBackupMetadataCache]; [DebugUIBackup logBackupMetadataCache];
}]]; }]];
[items addObject:[OWSTableItem itemWithTitle:@"Lazy Restore Attachments"
actionBlock:^{
[AppEnvironment.shared.backupLazyRestore runIfNecessary];
}]];
return [OWSTableSection sectionWithTitle:self.name items:items]; return [OWSTableSection sectionWithTitle:self.name items:items];
} }

@ -175,7 +175,7 @@ NSString *const kOWSBackup_ImportDatabaseKeySpec = @"kOWSBackup_ImportDatabaseKe
}) })
.then(^{ .then(^{
// Kick off lazy restore on main thread. // Kick off lazy restore on main thread.
[self.backupLazyRestore runIfNecessary]; [self.backupLazyRestore clearCompleteAndRunIfNecessary];
[self.profileManager fetchLocalUsersProfile]; [self.profileManager fetchLocalUsersProfile];

@ -53,6 +53,15 @@ public class BackupLazyRestore: NSObject {
private let backgroundQueue = DispatchQueue.global(qos: .background) private let backgroundQueue = DispatchQueue.global(qos: .background)
@objc
public func clearCompleteAndRunIfNecessary() {
AssertIsOnMainThread()
isComplete = false
runIfNecessary()
}
@objc @objc
public func runIfNecessary() { public func runIfNecessary() {
AssertIsOnMainThread() AssertIsOnMainThread()

Loading…
Cancel
Save