Explorar el Código

Run task asynchronously correctly

Nick Babcock hace 7 años
padre
commit
b6d594077c
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  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);