Clean up before PR.
This commit is contained in:
parent
9cca345777
commit
8d4ff5b320
2
Pods
2
Pods
@ -1 +1 @@
|
||||
Subproject commit 73ff9dcbe7dbe67365d85370c51973260bdb2ff9
|
||||
Subproject commit 148f33d0a8b93f784c3b247dc22315ccaa90b58c
|
||||
@ -177,6 +177,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
if (AppSetup.shouldTruncateGrdbWal) {
|
||||
// Try to truncate GRDB WAL before any readers or writers are
|
||||
// active.
|
||||
NSError *_Nullable error;
|
||||
[databaseStorage.grdbStorage syncTruncatingCheckpointAndReturnError:&error];
|
||||
if (error != nil) {
|
||||
|
||||
@ -147,8 +147,6 @@ extension YDBToGRDBMigration {
|
||||
|
||||
try self.migrate(migratorGroups: migratorGroups)
|
||||
|
||||
try! storage.syncTruncatingCheckpoint()
|
||||
|
||||
removeYdb()
|
||||
|
||||
let migrationDuration = abs(startDate.timeIntervalSinceNow)
|
||||
|
||||
@ -31,6 +31,33 @@ enum DatabaseObserverError: Error {
|
||||
case changeTooLarge
|
||||
}
|
||||
|
||||
@objc
|
||||
public class AtomicBool: NSObject {
|
||||
private var value: Bool
|
||||
|
||||
@objc
|
||||
public required init(_ value: Bool) {
|
||||
self.value = value
|
||||
}
|
||||
|
||||
// All instances can share a single queue.
|
||||
private static let serialQueue = DispatchQueue(label: "AtomicBool")
|
||||
|
||||
@objc
|
||||
public func get() -> Bool {
|
||||
return AtomicBool.serialQueue.sync {
|
||||
return self.value
|
||||
}
|
||||
}
|
||||
|
||||
@objc
|
||||
public func set(_ value: Bool) {
|
||||
return AtomicBool.serialQueue.sync {
|
||||
self.value = value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func AssertIsOnUIDatabaseObserverSerialQueue() {
|
||||
assert(UIDatabaseObserver.isOnUIDatabaseObserverSerialQueue)
|
||||
}
|
||||
@ -220,8 +247,6 @@ extension UIDatabaseObserver: TransactionObserver {
|
||||
isRunningCheckpoint = true
|
||||
}
|
||||
|
||||
SDSDatabaseStorage.shared.logFileSizes()
|
||||
|
||||
let result = try GRDBDatabaseStorageAdapter.checkpointWal(db: db, mode: mode)
|
||||
|
||||
Logger.info("walSizePages: \(result.walSizePages), pagesCheckpointed: \(result.pagesCheckpointed).")
|
||||
|
||||
@ -1,32 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
@objc
|
||||
public class AtomicBool: NSObject {
|
||||
private var value: Bool
|
||||
|
||||
@objc
|
||||
public required init(_ value: Bool) {
|
||||
self.value = value
|
||||
}
|
||||
|
||||
// All instances can share a single queue.
|
||||
private static let serialQueue = DispatchQueue(label: "AtomicBool")
|
||||
|
||||
@objc
|
||||
public func get() -> Bool {
|
||||
return AtomicBool.serialQueue.sync {
|
||||
return self.value
|
||||
}
|
||||
}
|
||||
|
||||
@objc
|
||||
public func set(_ value: Bool) {
|
||||
return AtomicBool.serialQueue.sync {
|
||||
self.value = value
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user