diff --git a/products/ASC.Files/Service/Program.cs b/products/ASC.Files/Service/Program.cs index f91dfd9a0a5..18840c4136f 100644 --- a/products/ASC.Files/Service/Program.cs +++ b/products/ASC.Files/Service/Program.cs @@ -74,8 +74,20 @@ public static IHostBuilder CreateHostBuilder(string[] args) => diHelper.TryAdd(typeof(ICacheNotify<>), typeof(KafkaCache<>)); diHelper.RegisterProducts(hostContext.Configuration, hostContext.HostingEnvironment.ContentRootPath); - services.AddHostedService(); - diHelper.TryAdd(); + + if (!bool.TryParse(hostContext.Configuration["disable_elastic"], out var disableElastic)) + { + disableElastic = false; + } + + if (!disableElastic) + { + services.AddHostedService(); + diHelper.TryAdd(); + //diHelper.TryAdd(); + diHelper.TryAdd(); + diHelper.TryAdd(); + } services.AddHostedService(); diHelper.TryAdd(); @@ -83,9 +95,6 @@ public static IHostBuilder CreateHostBuilder(string[] args) => services.AddHostedService(); diHelper.TryAdd(); - //diHelper.TryAdd(); - diHelper.TryAdd(); - diHelper.TryAdd(); }) .ConfigureContainer((context, builder) => {