Răsfoiți Sursa

Run task asynchronously correctly

Nick Babcock 7 ani în urmă
părinte
comite
b6d594077c
1 a modificat fișierele cu 1 adăugiri și 2 ștergeri
  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);