Skip to content

Commit

Permalink
Merge pull request #1035 from mpretty-cyro/feature/retrieve-snode-cac…
Browse files Browse the repository at this point in the history
…he-size

Added a function to retrieve the snode cache size from libSession
  • Loading branch information
mpretty-cyro authored Oct 7, 2024
2 parents a1c3d53 + 2bc8939 commit 8954a50
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion LibSession-Util
6 changes: 6 additions & 0 deletions SessionSnodeKit/LibSession/LibSession+Networking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ public extension LibSession {
network_clear_cache(network)
}

static func snodeCacheSize() -> Int {
guard let network: UnsafeMutablePointer<network_object> = networkCache.wrappedValue else { return 0 }

return network_get_snode_cache_size(network)
}

static func getSwarm(swarmPublicKey: String) -> AnyPublisher<Set<Snode>, Error> {
typealias Output = Result<Set<Snode>, Error>

Expand Down

0 comments on commit 8954a50

Please sign in to comment.