修正LocalStarClient.GetInfo的超时处理失误

This commit is contained in:
大石头 2022-03-04 22:19:41 +08:00
parent 8e157fadc4
commit 990b0f00ec
2 changed files with 3 additions and 1 deletions

View File

@ -60,7 +60,7 @@ namespace Stardust
/// <returns></returns>
public AgentInfo GetInfo()
{
var task = GetInfoAsync().ContinueWith<AgentInfo>(t => null, TaskContinuationOptions.OnlyOnFaulted);
var task = GetInfoAsync().ContinueWith(t => t.IsCompleted ? t.Result : null);
if (task.Wait(500)) return task.Result;
return null;

View File

@ -149,6 +149,8 @@ namespace Test
static async void Test6()
{
XTrace.WriteLine("Test6");
var client = new LocalStarClient();
client.GetInfo();