fix 增加判断下载逻辑

This commit is contained in:
2024-06-28 16:26:46 +08:00
parent d45955a9a0
commit 3ba6fd132a

View File

@@ -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<IDataDownloadService>();
ds.InitAsync(factory).Wait();
var ds = scope.ServiceProvider.GetService<IDataDownloadService>();
ds.InitAsync(factory).Wait();
}
}
}