refactor: TraceHttpClient 增加线程等待
This commit is contained in:
parent
b5539a875a
commit
574b2aeaf8
|
@ -17,7 +17,6 @@ namespace Bootstrap.Client.DataAccess
|
|||
/// 构造函数
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="httpContextAccessor"></param>
|
||||
public TraceHttpClient(HttpClient client) => _client = client;
|
||||
|
||||
/// <summary>
|
||||
|
@ -25,7 +24,7 @@ namespace Bootstrap.Client.DataAccess
|
|||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
/// <param name="user"></param>
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -66,7 +66,6 @@ namespace UnitTest
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="t"></param>
|
||||
/// <param name="callback"></param>
|
||||
public static void RevokeMapper(Action callback)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue