Selaa lähdekoodia

Run task asynchronously correctly

Nick Babcock 7 vuotta sitten
vanhempi
commit
b6d594077c
1 muutettua tiedostoa jossa 1 lisäystä ja 2 poistoa
  1. 1 2
      OhmGraphite/InfluxWriter.cs

+ 1 - 2
OhmGraphite/InfluxWriter.cs

@@ -33,8 +33,7 @@ namespace OhmGraphite
             }
 
             var task = client.SendAsync(writer);
-            task.RunSynchronously();
-            var result = task.Result;
+            var result = task.GetAwaiter().GetResult();
             if (!result.Success)
             {
                 Logger.Error("Influxdb encountered an error: {0}", result.ErrorMessage);