Skip to content

Commit

Permalink
added cloud log check
Browse files Browse the repository at this point in the history
  • Loading branch information
ctacke committed Apr 9, 2024
1 parent 2ace16e commit 9b22f57
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Source/Meadow.Logging.LogProviders/Driver/CloudLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,10 @@ private async Task Send<T>(string file, T item, Func<T, Task> sendFunc)
{
var serializeOptions = new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };

var connected = Resolver.Device.NetworkAdapters.Any(a => a.IsConnected);
var networkConnected = Resolver.Device.NetworkAdapters.Any(a => a.IsConnected);
var cloudConnected = Resolver.MeadowCloudService.ConnectionState == CloudConnectionState.Connected;

if (connected)
if (networkConnected && cloudConnected)
{
await semaphoreSlim.WaitAsync();

Expand Down

0 comments on commit 9b22f57

Please sign in to comment.