Skip to content

Commit

Permalink
Adding a comment to no-op errors on failed vacuum
Browse files Browse the repository at this point in the history
  • Loading branch information
mergesort committed Jan 22, 2024
1 parent 353d26e commit 7386ca7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/Bodega/SQLiteStorageEngine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,11 @@ public actor SQLiteStorageEngine: StorageEngine {
/// Removes all the `Data` items from the database.
public func removeAllData() throws {
try self.connection.run(Self.storageTable.delete())
let _ = try? self.connection.vacuum()
do {
try self.connection.vacuum()
} catch {
// We don't want the function to throw if vacuuming fails, so we treat it like a no-op.
}
}

/// Checks whether a value with a key is persisted.
Expand Down

0 comments on commit 7386ca7

Please sign in to comment.