Browse Source

feat: 添加程序预热

pull/145/head
Hanpaopao 11 months ago
parent
commit
d7f3f5fea0
  1. 7
      aspnet-core/frameworks/src/Lion.AbpPro.Starter/Lion/AbpPro/Starter/PreheatAbpProStarterContributor.cs
  2. 4
      aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/AbpProHttpApiHostModule.cs
  3. 1
      aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/Lion.AbpPro.HttpApi.Host.csproj
  4. 4
      aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/appsettings.json

7
aspnet-core/frameworks/src/Lion.AbpPro.Starter/Lion/AbpPro/Starter/PreheatAbpProStarterContributor.cs

@ -6,12 +6,13 @@ namespace Lion.AbpPro.Starter;
public class PreheatAbpProStarterContributor : IAbpProStarterContributor, ITransientDependency public class PreheatAbpProStarterContributor : IAbpProStarterContributor, ITransientDependency
{ {
private readonly IHttpClientFactory _httpClientFactory; private readonly IHttpClientFactory _httpClientFactory;
private PreheatOptions _options; private readonly PreheatOptions _options;
private ILogger<PreheatAbpProStarterContributor> _logger; private readonly ILogger<PreheatAbpProStarterContributor> _logger;
public PreheatAbpProStarterContributor(IHttpClientFactory httpClientFactory, IOptions<PreheatOptions> options) public PreheatAbpProStarterContributor(IHttpClientFactory httpClientFactory, IOptions<PreheatOptions> options, ILogger<PreheatAbpProStarterContributor> logger)
{ {
_httpClientFactory = httpClientFactory; _httpClientFactory = httpClientFactory;
_logger = logger;
_options = options.Value; _options = options.Value;
} }

4
aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/AbpProHttpApiHostModule.cs

@ -1,3 +1,4 @@
using Lion.AbpPro.Starter;
using Volo.Abp.BlobStoring.FileSystem; using Volo.Abp.BlobStoring.FileSystem;
using Volo.Abp.DistributedLocking; using Volo.Abp.DistributedLocking;
@ -17,7 +18,8 @@ namespace Lion.AbpPro
typeof(AbpAspNetCoreMvcUiBasicThemeModule), typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpCachingStackExchangeRedisModule), typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpDistributedLockingModule), typeof(AbpDistributedLockingModule),
typeof(AbpBlobStoringFileSystemModule) typeof(AbpBlobStoringFileSystemModule),
typeof(AbpProStarterModule)
//typeof(AbpBackgroundJobsHangfireModule) //typeof(AbpBackgroundJobsHangfireModule)
)] )]
public partial class AbpProHttpApiHostModule : AbpModule public partial class AbpProHttpApiHostModule : AbpModule

1
aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/Lion.AbpPro.HttpApi.Host.csproj

@ -46,6 +46,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\..\frameworks\src\Lion.AbpPro.CAP.EntityFrameworkCore\Lion.AbpPro.CAP.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\..\frameworks\src\Lion.AbpPro.CAP.EntityFrameworkCore\Lion.AbpPro.CAP.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\frameworks\src\Lion.AbpPro.CAP\Lion.AbpPro.CAP.csproj" /> <ProjectReference Include="..\..\..\frameworks\src\Lion.AbpPro.CAP\Lion.AbpPro.CAP.csproj" />
<ProjectReference Include="..\..\..\frameworks\src\Lion.AbpPro.Starter\Lion.AbpPro.Starter.csproj" />
<ProjectReference Include="..\..\..\shared\Lion.AbpPro.Shared.Hosting.Microservices\Lion.AbpPro.Shared.Hosting.Microservices.csproj" /> <ProjectReference Include="..\..\..\shared\Lion.AbpPro.Shared.Hosting.Microservices\Lion.AbpPro.Shared.Hosting.Microservices.csproj" />
<ProjectReference Include="..\..\src\Lion.AbpPro.Application\Lion.AbpPro.Application.csproj" /> <ProjectReference Include="..\..\src\Lion.AbpPro.Application\Lion.AbpPro.Application.csproj" />
<ProjectReference Include="..\..\src\Lion.AbpPro.EntityFrameworkCore\Lion.AbpPro.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\src\Lion.AbpPro.EntityFrameworkCore\Lion.AbpPro.EntityFrameworkCore.csproj" />

4
aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/appsettings.json

@ -74,5 +74,9 @@
}, },
"MiniProfiler": { "MiniProfiler": {
"Enabled": false "Enabled": false
},
"Preheat": {
"Enabled": true,
"RequestUrl": "http://localhost:44315/api/abp/application-configuration?IncludeLocalizationResources=false"
} }
} }
Loading…
Cancel
Save