diff --git a/Src/Dlhis.Middle/Program.cs b/Src/Dlhis.Middle/Program.cs index 30cb0fdd..24540a9a 100644 --- a/Src/Dlhis.Middle/Program.cs +++ b/Src/Dlhis.Middle/Program.cs @@ -46,10 +46,13 @@ public class Startup : DefaultStartup { base.Configure(app, env); - using var scope = app.ApplicationServices.CreateScope(); - var factory = Configuration.GetSection("Factory").Value; + if (Configuration.GetSection("Download").Value == "1") + { + using var scope = app.ApplicationServices.CreateScope(); + var factory = Configuration.GetSection("Factory").Value; - var ds = scope.ServiceProvider.GetService(); - ds.InitAsync(factory).Wait(); + var ds = scope.ServiceProvider.GetService(); + ds.InitAsync(factory).Wait(); + } } } \ No newline at end of file