Quellcode durchsuchen

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 vor 5 Jahren
committed by GitHub
Ursprung
Commit
6a90864c44
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden GPG-Schlüssel-ID: 4AEE18F83AFDEB23
1 geänderte Dateien mit 8 neuen und 1 gelöschten Zeilen
  1. +8
    -1
      Source/MQTTnet.Extensions.ManagedClient/ManagedMqttClient.cs

+ 8
- 1
Source/MQTTnet.Extensions.ManagedClient/ManagedMqttClient.cs Datei anzeigen

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


Laden…
Abbrechen
Speichern