Introducing a in progress sentinel that gets verified before running the first time experience. If we can get a handle for this sentinel, we proceed with the first time run, otherwise, it means there is a first time experience running already, in which case we continue running dotnet normally, even though the final (real) sentinel is not present yet. This prevents multiple dotnet commands from running the first time experience in parallel and prevents us from running into parallel nuget restores.

This commit is contained in:
Livar Cunha 2016-06-10 15:06:48 -07:00
parent ed7e583ab6
commit 105e5ab051
12 changed files with 240 additions and 25 deletions

View file

@ -166,17 +166,19 @@ namespace Microsoft.DotNet.Cli
{
using (var nugetPackagesArchiver = new NuGetPackagesArchiver())
{
var environmentProvider = new EnvironmentProvider();
var nugetCacheSentinel = new NuGetCacheSentinel();
var commandFactory = new DotNetCommandFactory();
var nugetCachePrimer =
new NuGetCachePrimer(commandFactory, nugetPackagesArchiver, nugetCacheSentinel);
var dotnetConfigurer = new DotnetFirstTimeUseConfigurer(
nugetCachePrimer,
nugetCacheSentinel,
environmentProvider);
using (var nugetCacheSentinel = new NuGetCacheSentinel())
{
var environmentProvider = new EnvironmentProvider();
var commandFactory = new DotNetCommandFactory();
var nugetCachePrimer =
new NuGetCachePrimer(commandFactory, nugetPackagesArchiver, nugetCacheSentinel);
var dotnetConfigurer = new DotnetFirstTimeUseConfigurer(
nugetCachePrimer,
nugetCacheSentinel,
environmentProvider);
dotnetConfigurer.Configure();
dotnetConfigurer.Configure();
}
}
}
}