1
0
Эх сурвалжийг харах

Run task asynchronously correctly

Nick Babcock 7 жил өмнө
parent
commit
b6d594077c

+ 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);