Skip to content

Commit

Permalink
add startup to another thread
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali-YousefiTelori committed Oct 3, 2023
1 parent 3b5226d commit d9b7791
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static async Task StartServer()
return;
IsStarted = true;
TaskCompletionSource taskCompletionSource = new TaskCompletionSource();
_ = Task.Run(async () =>
Thread thread = new Thread(async () =>
{
await WebApi.Program.Run(null, (s) =>
{
Expand All @@ -33,8 +33,9 @@ await WebApi.Program.Run(null, (s) =>
{
service = p;
taskCompletionSource.SetResult();
});
}).ConfigureAwait(false);
});
thread.Start();
await taskCompletionSource.Task;

if (await PaymentsVirtualTestManager.OnInitialize(PaymentComponentPort))
Expand Down

0 comments on commit d9b7791

Please sign in to comment.