fix 多钱包调整

This commit is contained in:
2024-11-08 16:36:10 +08:00
parent 36bfd2e8f6
commit 1a0ba28249
36 changed files with 418 additions and 434 deletions

View File

@@ -1,5 +1,5 @@
using Dlhis.Middle.BackgroundServices;
using Dlhis.Middle.Services;
using Dlhis.Middle.Services.Implements;
using Kurisu.AspNetCore;
using Kurisu.AspNetCore.Startup;
using Microsoft.IdentityModel.Logging;
@@ -24,20 +24,11 @@ public class Startup : DefaultStartup
public override void ConfigureServices(IServiceCollection services)
{
base.ConfigureServices(services);
services.AddHostedService<BalanceRecordUploadBackgroundService>();
services.AddHostedService<HealthCheckBackgroundService>();
services.AddRemoteCall(App.ActiveTypes);
services.AddHttpClient("face", client => { client.Timeout = TimeSpan.FromSeconds(30); }).ConfigurePrimaryHttpMessageHandler(() =>
{
var handler = new HttpClientHandler
{
ClientCertificateOptions = ClientCertificateOption.Manual,
ServerCertificateCustomValidationCallback = (_, _, _, _) => true
};
return handler;
});
services.AddHostedService<BalanceRecordCheckBackgroundService>();
services.AddHostedService<HealthCheckBackgroundService>();
services.AddMemoryCache();
}
@@ -49,10 +40,9 @@ public class Startup : DefaultStartup
if (Configuration.GetSection("Download").Value == "1")
{
using var scope = app.ApplicationServices.CreateScope();
var factory = Configuration.GetSection("Factory").Value;
var factories = scope.ServiceProvider.GetService<ISettingService>().GetFactories();
var ds = scope.ServiceProvider.GetService<IDataDownloadService>();
ds.InitAsync(factory).Wait();
ds.InitAsync(factories).Wait();
}
}
}