diff --git a/EdgeAgentSDK/Pluto/Sources/PersistentStorage/DAO/CDMessageDAO+MessageStore.swift b/EdgeAgentSDK/Pluto/Sources/PersistentStorage/DAO/CDMessageDAO+MessageStore.swift index 8497c4b0..4bc15964 100644 --- a/EdgeAgentSDK/Pluto/Sources/PersistentStorage/DAO/CDMessageDAO+MessageStore.swift +++ b/EdgeAgentSDK/Pluto/Sources/PersistentStorage/DAO/CDMessageDAO+MessageStore.swift @@ -44,11 +44,13 @@ extension CDMessageDAO: MessageStore { .first() .map { $0.first } .flatMap { pair in - self.updateOrCreate( - msg.id, - context: writeContext - ) { cdobj, _ in - try cdobj.fromDomain(msg: msg, direction: direction, pair: pair) + Future { + self.updateOrCreate( + msg.id, + context: writeContext + ) { cdobj, _ in + try cdobj.fromDomain(msg: msg, direction: direction, pair: pair) + } } } .map { _ in }