Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion src/Http/CrazyStartingWebApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
builder.Services.AddWolverine(c =>
{
//c.ApplicationAssembly = typeof(Endpoint1).Assembly;
c.CodeGeneration.TypeLoadMode = TypeLoadMode.Static;
//c.CodeGeneration.TypeLoadMode = TypeLoadMode.Static;
});
builder.Services.AddWolverineHttp();
builder.Services.AddHostedService<ClientHostedService>();
Expand Down
12 changes: 11 additions & 1 deletion src/Http/Wolverine.Http/HttpChain.EndpointBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,17 @@ public RouteEndpoint BuildEndpoint(RouteWarmup warmup)
var handler = new Lazy<HttpHandler>(() =>
{
this.InitializeSynchronously(_parent.Rules, _parent, _parent.Container.Services);
return (HttpHandler)_parent.Container.QuickBuild(_handlerType);

try
{
return (HttpHandler)_parent.Container.QuickBuild(_handlerType);
}
catch (Exception e)
{
throw new InvalidOperationException(
"Wolverine may be having trouble with concurrent access to the same route at startup. Set the WolverineHttpOptions.Warmup = Eager to work around this problem",
e);
}
});

requestDelegate = c => handler.Value.Handle(c);
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Wolverine.Http/HttpGraph.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void DiscoverEndpoints(WolverineHttpOptions wolverineHttpOptions)

foreach (var policy in wolverineHttpOptions.Policies) policy.Apply(_chains, Rules, Container);

_endpoints.AddRange(_chains.Select(x => x.BuildEndpoint(RouteWarmup.Lazy)));
_endpoints.AddRange(_chains.Select(x => x.BuildEndpoint(wolverineHttpOptions.WarmUpRoutes)));
}

public override IChangeToken GetChangeToken()
Expand Down
11 changes: 11 additions & 0 deletions src/Wolverine/Codegen/ServiceLocationPlan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ protected override bool requiresServiceProvider(IMethodVariables method)

public override string WhyRequireServiceProvider(IMethodVariables method)
{
if (Descriptor.IsKeyedService)
{
if (Descriptor.KeyedImplementationFactory != null)
{
return
$"The service registration for {Descriptor.ServiceType.FullNameInCode()} is an 'opaque' lambda factory with the {Descriptor.Lifetime} lifetime and requires service location";
}

return $"Concrete type {Descriptor.KeyedImplementationType.FullNameInCode()} is not public, so requires service location";
}

if (Descriptor.ImplementationFactory != null)
{
return
Expand Down
2 changes: 1 addition & 1 deletion src/Wolverine/Wolverine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PackageId>WolverineFx</PackageId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="JasperFx" Version="1.0.5" />
<PackageReference Include="JasperFx" Version="1.1.0" />
<PackageReference Include="JasperFx.RuntimeCompiler" Version="4.0.0" />
<PackageReference Include="NewId" Version="4.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
Expand Down
Loading