Skip to content
Snippets Groups Projects
Commit c239976b authored by Andreia Gaita's avatar Andreia Gaita
Browse files

Switch to await model for startup

parent 63b14edc
No related branches found
No related tags found
No related merge requests found
......@@ -32,20 +32,24 @@ namespace GitHub.Unity
public virtual Task Run()
{
return Task.Factory.StartNew(() =>
Task task = null;
try
{
try
{
Environment.GitExecutablePath = DetermineGitInstallationPath();
Environment.Repository = GitClient.GetRepository();
}
catch (Exception ex)
{
logger.Error(ex);
throw;
}
});
task = RunInternal();
}
catch (Exception ex)
{
logger.Error(ex);
throw;
}
return task;
}
private async Task RunInternal()
{
await ThreadingHelper.SwitchToThreadAsync();
Environment.GitExecutablePath = DetermineGitInstallationPath();
Environment.Repository = GitClient.GetRepository();
}
private string DetermineGitInstallationPath()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment