Skip to content

Commit

Permalink
fliped around logic for Execute and ExecuteAsync, Execute now passes …
Browse files Browse the repository at this point in the history
…through to ExecuteAsync
  • Loading branch information
kelmelzer committed Jul 19, 2024
1 parent 5317408 commit 446d42d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Appium.Net/Appium.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</PackageReference>
<PackageReference Include="Selenium.Support" Version="4.23.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.23.0" />
<PackageReference Include="System.Drawing.Common" Version="8.0.6" />
<PackageReference Include="System.Drawing.Common" Version="8.0.7" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
Expand Down
8 changes: 4 additions & 4 deletions src/Appium.Net/Appium/Service/AppiumCommandExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,16 @@ internal AppiumCommandExecutor(AppiumLocalService service, TimeSpan timeForTheSe
ClientConfig = clientConfig;
}

public Response Execute(Command commandToExecute)
public Response Execute(Command commandToExecute) => this.ExecuteAsync(commandToExecute).GetAwaiter().GetResult();

public async Task<Response> ExecuteAsync(Command commandToExecute)
{
Response result = null;

try
{
bool newSession = HandleNewSessionCommand(commandToExecute);
result = RealExecutor.Execute(commandToExecute);
result = await RealExecutor.ExecuteAsync(commandToExecute);
if (newSession)
{
RealExecutor = UpdateExecutor(result, RealExecutor);
Expand All @@ -80,8 +82,6 @@ public Response Execute(Command commandToExecute)
}
}

public Task<Response> ExecuteAsync(Command commandToExecute) => Task.Run(() => this.Execute(commandToExecute));

/// <summary>
/// Handles a new session command, starts the service, and modifies the HTTP request header if necessary.
/// </summary>
Expand Down

0 comments on commit 446d42d

Please sign in to comment.