From 3ba6fd132a8128a2c9f87b3ae6e9d1c18c889f08 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Fri, 28 Jun 2024 16:26:46 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=A2=9E=E5=8A=A0=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Dlhis.Middle/Program.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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