Skip to content

Commit

Permalink
Revert "Update AppiumCommandExecutor.cs"
Browse files Browse the repository at this point in the history
This reverts commit c2ebe40.
  • Loading branch information
kelmelzer committed Jul 19, 2024
1 parent 656fd33 commit e9085e2
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/Appium.Net/Appium/Service/AppiumCommandExecutor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//Licensed under the Apache License, Version 2.0 (the "License");
//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//See the NOTICE file distributed with this work for additional
//information regarding copyright ownership.
Expand All @@ -14,7 +14,6 @@

using OpenQA.Selenium.Remote;
using System;
using System.Threading.Tasks;

namespace OpenQA.Selenium.Appium.Service
{
Expand Down Expand Up @@ -55,19 +54,13 @@ internal AppiumCommandExecutor(AppiumLocalService service, TimeSpan timeForTheSe
}

public Response Execute(Command commandToExecute)
{
return Task.Run(() => RealExecutor.ExecuteAsync(commandToExecute)).GetAwaiter().GetResult();
}

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

try
{
bool newSession = HandleNewSessionCommand(commandToExecute);
result = Task.Run(() => RealExecutor.ExecuteAsync(commandToExecute)).GetAwaiter().GetResult();

result = RealExecutor.Execute(commandToExecute);
if (newSession)
{
RealExecutor = UpdateExecutor(result, RealExecutor);
Expand Down Expand Up @@ -132,7 +125,7 @@ private void HandleCommandException(Command command)
if (command.Name == DriverCommand.NewSession)
{
Service?.Dispose();
}
}
}

/// <summary>
Expand Down

0 comments on commit e9085e2

Please sign in to comment.