Skip to content

Commit

Permalink
Breaking retain cycle in Persistent Provider Cache
Browse files Browse the repository at this point in the history
  • Loading branch information
alina-v1 committed Jul 27, 2023
1 parent 0323101 commit 132ed41
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public class PersistentProviderCache: ProviderCache {

persistPublisher
.throttle(for: 30.0, scheduler: persistQueue, latest: true)
.sink { _ in
.sink { [weak self] _ in
guard let self else { return }
do {
try self.persist()
} catch {
Expand Down

0 comments on commit 132ed41

Please sign in to comment.