Skip to content

Commit e0dc17d

Browse files
committed
Store value in memory when retrieving a cached value
1 parent 6e6c75a commit e0dc17d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

AsyncMux/Sources/Multiplexer.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ public final class Multiplexer<T: Codable & Sendable>: MuxRepositoryProtocol {
9797
/// Returns the value currently stored in memory or on disk, ignoring the TTL
9898
public var cachedValue: T? {
9999
storedValue ?? cacheKey.flatMap {
100-
MuxCacher.load(domain: MuxRootDomain, key: $0, type: T.self)
100+
storedValue = MuxCacher.load(domain: MuxRootDomain, key: $0, type: T.self)
101+
return storedValue
101102
}
102103
}
103104

0 commit comments

Comments
 (0)