mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-08-30 23:00:18 -04:00
Merge pull request #14653 from evan314159/coremigration
Delay initialization of singleton services during migration CoreInitialisation stage
This commit is contained in:
parent
ffb7753f8d
commit
7aa1c46447
@ -34,13 +34,9 @@ internal class CodeMigration(Type migrationType, JellyfinMigrationAttribute meta
|
|||||||
{
|
{
|
||||||
if (service.Lifetime == ServiceLifetime.Singleton && !service.ServiceType.IsGenericTypeDefinition)
|
if (service.Lifetime == ServiceLifetime.Singleton && !service.ServiceType.IsGenericTypeDefinition)
|
||||||
{
|
{
|
||||||
object? serviceInstance = serviceProvider.GetService(service.ServiceType);
|
childServiceCollection.AddSingleton(service.ServiceType, _ => serviceProvider.GetService(service.ServiceType)!);
|
||||||
if (serviceInstance != null)
|
|
||||||
{
|
|
||||||
childServiceCollection.AddSingleton(service.ServiceType, serviceInstance);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
childServiceCollection.Add(service);
|
childServiceCollection.Add(service);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user