修正LocalStarClient.GetInfo的超时处理失误
This commit is contained in:
parent
8e157fadc4
commit
990b0f00ec
|
@ -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;
|
||||
|
|
|
@ -149,6 +149,8 @@ namespace Test
|
|||
|
||||
static async void Test6()
|
||||
{
|
||||
XTrace.WriteLine("Test6");
|
||||
|
||||
var client = new LocalStarClient();
|
||||
client.GetInfo();
|
||||
|
||||
|
|
Loading…
Reference in New Issue