Skip to content

Commit 9790bd8

Browse files
committed
Tweaks suggested in code review
1 parent 79ce459 commit 9790bd8

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

Modules/Sources/Storage/GRDB/GRDBManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public protocol GRDBDatabaseConnection: DatabaseReader & DatabaseWriter {}
99

1010
public final class GRDBManager: GRDBManagerProtocol {
1111

12-
public var databaseConnection: GRDBDatabaseConnection
12+
public let databaseConnection: GRDBDatabaseConnection
1313

1414
public init(databasePath: String) throws {
1515
let databaseURL = URL(fileURLWithPath: databasePath)

WooCommerce/Classes/ServiceLocator/ServiceLocator.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,12 @@ final class ServiceLocator {
205205

206206
guard let grdbManager = _grdbManager else {
207207
do {
208-
let documentsPath = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!
208+
guard let documentsPath = FileManager.default.urls(
209+
for: .documentDirectory,
210+
in: .userDomainMask).first else {
211+
fatalError("Failed to get the path to the documents directory.")
212+
}
213+
209214
let databasePath = documentsPath.appendingPathComponent(WooConstants.localSQLiteDatabaseName).path
210215
let manager = try GRDBManager(databasePath: databasePath)
211216
DDLogInfo("Started GRDBManager with database path: \(databasePath)")

WooCommerce/Classes/System/WooConstants.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public enum WooConstants {
1515

1616
/// Local SQLite Database Name
1717
///
18-
static let localSQLiteDatabaseName = "woo-local.db"
18+
static let localSQLiteDatabaseName = "woo-local.sqlite"
1919

2020
/// Keychain Access's Service Name
2121
///

0 commit comments

Comments
 (0)