Browse Source

Merge pull request #19090 from abpframework/rel-8.1-PRs

Cherry pick commits from `prerel-8.1` to `rel-8.1`.
pull/19091/head
liangshiwei 3 years ago
committed by GitHub
parent
commit
992b383f24
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 10
      framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcRemoteTenantStore.cs
  2. 8
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceTemplateBase.cs
  3. 4
      modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/TenantStore.cs

10
framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcRemoteTenantStore.cs

@ -40,9 +40,9 @@ public class MvcRemoteTenantStore : ITenantStore, ITransientDependency
} }
var tenantConfiguration = await Cache.GetAsync(cacheKey); var tenantConfiguration = await Cache.GetAsync(cacheKey);
if (tenantConfiguration == null) if (tenantConfiguration?.Value == null)
{ {
await TenantAppService.FindTenantByNameAsync(normalizedName); var tenant = await TenantAppService.FindTenantByNameAsync(normalizedName);
tenantConfiguration = await Cache.GetAsync(cacheKey); tenantConfiguration = await Cache.GetAsync(cacheKey);
} }
@ -65,7 +65,7 @@ public class MvcRemoteTenantStore : ITenantStore, ITransientDependency
} }
var tenantConfiguration = await Cache.GetAsync(cacheKey); var tenantConfiguration = await Cache.GetAsync(cacheKey);
if (tenantConfiguration == null) if (tenantConfiguration?.Value == null)
{ {
await TenantAppService.FindTenantByIdAsync(id); await TenantAppService.FindTenantByIdAsync(id);
tenantConfiguration = await Cache.GetAsync(cacheKey); tenantConfiguration = await Cache.GetAsync(cacheKey);
@ -90,7 +90,7 @@ public class MvcRemoteTenantStore : ITenantStore, ITransientDependency
} }
var tenantConfiguration = Cache.Get(cacheKey); var tenantConfiguration = Cache.Get(cacheKey);
if (tenantConfiguration == null) if (tenantConfiguration?.Value == null)
{ {
AsyncHelper.RunSync(async () => await TenantAppService.FindTenantByNameAsync(normalizedName)); AsyncHelper.RunSync(async () => await TenantAppService.FindTenantByNameAsync(normalizedName));
tenantConfiguration = Cache.Get(cacheKey); tenantConfiguration = Cache.Get(cacheKey);
@ -115,7 +115,7 @@ public class MvcRemoteTenantStore : ITenantStore, ITransientDependency
} }
var tenantConfiguration = Cache.Get(cacheKey); var tenantConfiguration = Cache.Get(cacheKey);
if (tenantConfiguration == null) if (tenantConfiguration?.Value == null)
{ {
AsyncHelper.RunSync(async () => await TenantAppService.FindTenantByIdAsync(id)); AsyncHelper.RunSync(async () => await TenantAppService.FindTenantByIdAsync(id));
tenantConfiguration = Cache.Get(cacheKey); tenantConfiguration = Cache.Get(cacheKey);

8
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceTemplateBase.cs

@ -131,6 +131,14 @@ public abstract class MicroserviceTemplateBase : TemplateInfo
private static void DeleteUnrelatedProjects(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps) private static void DeleteUnrelatedProjects(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{ {
if (!context.BuildArgs.PublicWebSite)
{
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.PublicWeb", null, "apps/public-web/src/MyCompanyName.MyProjectName.PublicWeb"));
steps.Add(new RemoveFolderStep("/apps/public-web"));
steps.Add(new RemoveProjectFromTyeStep("public-web"));
steps.Add(new RemoveProjectFromPrometheusStep("public-web"));
}
//TODO: move common tasks to methods //TODO: move common tasks to methods
switch (context.BuildArgs.UiFramework) switch (context.BuildArgs.UiFramework)
{ {

4
modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/TenantStore.cs

@ -54,7 +54,7 @@ public class TenantStore : ITenantStore, ITransientDependency
var cacheKey = CalculateCacheKey(id, normalizedName); var cacheKey = CalculateCacheKey(id, normalizedName);
var cacheItem = await Cache.GetAsync(cacheKey, considerUow: true); var cacheItem = await Cache.GetAsync(cacheKey, considerUow: true);
if (cacheItem != null) if (cacheItem?.Value != null)
{ {
return cacheItem; return cacheItem;
} }
@ -94,7 +94,7 @@ public class TenantStore : ITenantStore, ITransientDependency
var cacheKey = CalculateCacheKey(id, normalizedName); var cacheKey = CalculateCacheKey(id, normalizedName);
var cacheItem = Cache.Get(cacheKey, considerUow: true); var cacheItem = Cache.Get(cacheKey, considerUow: true);
if (cacheItem != null) if (cacheItem?.Value != null)
{ {
return cacheItem; return cacheItem;
} }

Loading…
Cancel
Save