File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ public let OcaDatagramProxyConnectionPrefix = "oca/dg-proxy"
6767public struct Ocp1ConnectionFlags : OptionSet , Sendable {
6868 public static let automaticReconnect = Ocp1ConnectionFlags ( rawValue: 1 << 0 )
6969 public static let refreshDeviceTreeOnConnection = Ocp1ConnectionFlags ( rawValue: 1 << 1 )
70+ public static let retainObjectCacheAfterDisconnect = Ocp1ConnectionFlags ( rawValue: 1 << 2 )
7071
7172 public typealias RawValue = UInt
7273
@@ -455,7 +456,10 @@ public extension Ocp1Connection {
455456
456457 func disconnect( ) async throws {
457458 await removeSubscriptions ( )
458- try await disconnectDevice ( clearObjectCache: true )
459+ try await disconnectDevice (
460+ clearObjectCache: !options. flags
461+ . contains ( . retainObjectCacheAfterDisconnect)
462+ )
459463 }
460464}
461465
You can’t perform that action at this time.
0 commit comments