Browse Source

Merge pull request #666 from vbBerni/develop

fix Managed Client removes failed messages from message queue but not from storage manager
release/3.x.x
Christian 5 years ago
committed by GitHub
parent
commit
6a90864c44
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      Source/MQTTnet.Extensions.ManagedClient/ManagedMqttClient.cs

+ 8
- 1
Source/MQTTnet.Extensions.ManagedClient/ManagedMqttClient.cs View File

@@ -387,7 +387,10 @@ namespace MQTTnet.Extensions.ManagedClient
//removed it, in which case we don't want to do anything. //removed it, in which case we don't want to do anything.
_messageQueue.RemoveFirst(i => i.Id.Equals(message.Id)); _messageQueue.RemoveFirst(i => i.Id.Equals(message.Id));
} }
_storageManager?.RemoveAsync(message).GetAwaiter().GetResult();
if (_storageManager != null)
{
_storageManager.RemoveAsync(message).GetAwaiter().GetResult();
}
} }
catch (MqttCommunicationException exception) catch (MqttCommunicationException exception)
{ {
@@ -408,6 +411,10 @@ namespace MQTTnet.Extensions.ManagedClient
{ {
_messageQueue.RemoveFirst(i => i.Id.Equals(message.Id)); _messageQueue.RemoveFirst(i => i.Id.Equals(message.Id));
} }
if (_storageManager != null)
{
_storageManager.RemoveAsync(message).GetAwaiter().GetResult();
}
} }
} }
catch (Exception exception) catch (Exception exception)


Loading…
Cancel
Save