From 574b2aeaf8c46c3c85f99a92a4d4eb38bc2363c9 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 12 Oct 2019 20:50:55 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20TraceHttpClient=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=BA=BF=E7=A8=8B=E7=AD=89=E5=BE=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bootstrap.Client.DataAccess/Helper/TraceHttpClient.cs | 6 +++--- test/UnitTest/TestHelper.cs | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/client/Bootstrap.Client.DataAccess/Helper/TraceHttpClient.cs b/src/client/Bootstrap.Client.DataAccess/Helper/TraceHttpClient.cs index 16c381f2..1be906d7 100644 --- a/src/client/Bootstrap.Client.DataAccess/Helper/TraceHttpClient.cs +++ b/src/client/Bootstrap.Client.DataAccess/Helper/TraceHttpClient.cs @@ -17,7 +17,6 @@ namespace Bootstrap.Client.DataAccess /// 构造函数 /// /// - /// public TraceHttpClient(HttpClient client) => _client = client; /// @@ -25,7 +24,7 @@ namespace Bootstrap.Client.DataAccess /// /// /// - public async void Post(HttpContext context, OnlineUser user) + public void Post(HttpContext context, OnlineUser user) { // 调用 后台跟踪接口 // http://localhost:50852/api/Traces @@ -33,7 +32,8 @@ namespace Bootstrap.Client.DataAccess try { - await _client.PostAsJsonAsync("", user, context.RequestAborted); + var t = _client.PostAsJsonAsync("", user, context.RequestAborted); + t.Wait(2000); } catch (Exception ex) { diff --git a/test/UnitTest/TestHelper.cs b/test/UnitTest/TestHelper.cs index 59d1eeeb..58e5a414 100644 --- a/test/UnitTest/TestHelper.cs +++ b/test/UnitTest/TestHelper.cs @@ -66,7 +66,6 @@ namespace UnitTest /// /// /// - /// /// public static void RevokeMapper(Action callback) {