Why tenant initializer is called mutiple times? #14640
Replies: 2 comments
-
@jtkech any ideas? |
Beta Was this translation helpful? Give feedback.
-
Before building a shell container we first create a light container to be able to query the database to retrieve the shell descriptor, but this 1st container is built with an empty descriptor without any feature so no startups are executed, and it doesn't activate the shell so no tenant event handlers are executed. But yes if you register a container initializer Then in the But recently we updated the So now, if the tenants distributed is not enabled, a container initializer is called 2 + 1 = 3 times, this while building 2 light temporary containers and only one full shell container. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have 2 tenants:
When I add initializer I see
info: OrchardCore.Environment.Shell.ShellHost[0]
Start creation of shells
info: OrchardCore.Environment.Shell.Builders.ShellContextFactory[0]
Creating shell context for tenant 'Default'
dbug: OrchardCore.Environment.Shell.Builders.ShellContextFactory[0]
Creating described context for tenant 'Default'
dbug: OrchardCore.Environment.Shell.Builders.CompositionStrategy[0]
Composing blueprint
dbug: OrchardCore.Environment.Shell.Builders.CompositionStrategy[0]
Done composing blueprint
info: Microsoft.Hosting.Lifetime[14]
Now listening on: https://localhost:4651
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://localhost:4652
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
Content root path: C:\Users\Andrii\Dev\Lula\risk-assessment\app\presentation\WebHost
Configuring 'self_signed_jwt' authentication strategy on Development environment.
Initializer called for Default
dbug: OrchardCore.Environment.Shell.Builders.ShellContextFactory[0]
Creating described context for tenant 'Default'
dbug: OrchardCore.Environment.Shell.Builders.CompositionStrategy[0]
Composing blueprint
dbug: OrchardCore.Environment.Shell.Builders.CompositionStrategy[0]
Done composing blueprint
Configuring 'self_signed_jwt' authentication strategy on Development environment.
Initializer called for Default
dbug: OrchardCore.Environment.Shell.ShellHost[0]
Registering shell context for tenant 'Default'
dbug: OrchardCore.Environment.Shell.ShellHost[0]
Registering shell context for tenant 'Sandbox'
info: OrchardCore.Environment.Shell.ShellHost[0]
Done pre-creating and registering shells
dbug: OrchardCore.Environment.Shell.ShellHost[0]
Creating shell context for tenant 'Default'
dbug: OrchardCore.Environment.Shell.ShellHost[0]
Creating shell context for tenant 'Sandbox'
info: OrchardCore.Environment.Shell.Builders.ShellContextFactory[0]
Creating shell context for tenant 'Default'
info: OrchardCore.Environment.Shell.Builders.ShellContextFactory[0]
Creating shell context for tenant 'Sandbox'
dbug: OrchardCore.Environment.Shell.Builders.ShellContextFactory[0]
Creating described context for tenant 'Default'
dbug: OrchardCore.Environment.Shell.Builders.ShellContextFactory[0]
Creating described context for tenant 'Sandbox'
dbug: OrchardCore.Environment.Shell.Builders.CompositionStrategy[0]
Composing blueprint
dbug: OrchardCore.Environment.Shell.Builders.CompositionStrategy[0]
Done composing blueprint
dbug: OrchardCore.Environment.Shell.Builders.CompositionStrategy[0]
Composing blueprint
Configuring 'self_signed_jwt' authentication strategy on Development environment.
dbug: OrchardCore.Environment.Shell.Builders.CompositionStrategy[0]
Done composing blueprint
Configuring 'self_signed_jwt' authentication strategy on Development environment.
Initializer called for Default
Initializer called for Sandbox
dbug: OrchardCore.Environment.Shell.Builders.ShellContextFactory[0]
Creating described context for tenant 'Default'
dbug: OrchardCore.Environment.Shell.Builders.ShellContextFactory[0]
Creating described context for tenant 'Sandbox'
dbug: OrchardCore.Environment.Shell.Builders.CompositionStrategy[0]
Composing blueprint
dbug: OrchardCore.Environment.Shell.Builders.CompositionStrategy[0]
Composing blueprint
dbug: OrchardCore.Environment.Shell.Builders.CompositionStrategy[0]
Done composing blueprint
dbug: OrchardCore.Environment.Shell.Builders.CompositionStrategy[0]
Done composing blueprint
Initializer called for Sandbox
Initializer called for Default
dbug: OrchardCore.Environment.Shell.ShellHost[0]
Registering shell context for tenant 'Default'
dbug: OrchardCore.Environment.Shell.ShellHost[0]
Registering shell context for tenant 'Sandbox'
Notice that the initializer for
Default
was called 4 times and forSandbox
2 times.Why does this happen and how to avoid that?
Beta Was this translation helpful? Give feedback.
All reactions