Skip to content

Commit

Permalink
Merge pull request #329 from keniwhat/master
Browse files Browse the repository at this point in the history
Allos custom FileManager to be passed in for DiskStorage.
  • Loading branch information
3lvis authored Jul 29, 2024
2 parents dff9930 + ddce7b9 commit d2e8f5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Shared/Storage/Storage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public final class Storage<Key: Hashable, Value> {
/// - diskConfig: Configuration for disk storage
/// - memoryConfig: Optional. Pass config if you want memory cache
/// - Throws: Throw StorageError if any.
public convenience init(diskConfig: DiskConfig, memoryConfig: MemoryConfig, transformer: Transformer<Value>) throws {
let disk = try DiskStorage<Key, Value>(config: diskConfig, transformer: transformer)
public convenience init(diskConfig: DiskConfig, memoryConfig: MemoryConfig, fileManager: FileManager, transformer: Transformer<Value>) throws {
let disk = try DiskStorage<Key, Value>(config: diskConfig, fileManager: fileManager, transformer: transformer)
let memory = MemoryStorage<Key, Value>(config: memoryConfig)
let hybridStorage = HybridStorage(memoryStorage: memory, diskStorage: disk)
self.init(hybridStorage: hybridStorage)
Expand Down

0 comments on commit d2e8f5a

Please sign in to comment.