diff --git a/SignalServiceKit/src/Loki/API/LokiAPI.swift b/SignalServiceKit/src/Loki/API/LokiAPI.swift index ea60e5440..d69c1abde 100644 --- a/SignalServiceKit/src/Loki/API/LokiAPI.swift +++ b/SignalServiceKit/src/Loki/API/LokiAPI.swift @@ -2,10 +2,12 @@ import PromiseKit @objc(LKAPI) public final class LokiAPI : NSObject { + private static let stateQueue = DispatchQueue(label: "stateQueue") + /// Only ever modified from the message processing queue (`OWSBatchMessageProcessor.processingQueue`). private static var syncMessageTimestamps: [String:Set] = [:] - public static var _lastDeviceLinkUpdate: [String:Date] = [:] + private static var _lastDeviceLinkUpdate: [String:Date] = [:] /// A mapping from hex encoded public key to date updated. public static var lastDeviceLinkUpdate: [String:Date] { get { stateQueue.sync { _lastDeviceLinkUpdate } } @@ -19,8 +21,6 @@ public final class LokiAPI : NSObject { set { stateQueue.sync { _userHexEncodedPublicKeyCache = newValue } } } - private static let stateQueue = DispatchQueue(label: "stateQueue") - /// All service node related errors must be handled on this queue to avoid race conditions maintaining e.g. failure counts. public static let errorHandlingQueue = DispatchQueue(label: "errorHandlingQueue")